﻿using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient.UI
{
	// Token: 0x0200191F RID: 6431
	internal class DungeonSelect : DlgBase<DungeonSelect, DungeonSelectBehaviour>
	{
		// Token: 0x17003AF3 RID: 15091
		// (get) Token: 0x06010D40 RID: 68928 RVA: 0x0043CE40 File Offset: 0x0043B040
		// (set) Token: 0x06010D41 RID: 68929 RVA: 0x0043CE58 File Offset: 0x0043B058
		private bool _bLevelIsMoving
		{
			get
			{
				return this.m_bLevelIsMoving;
			}
			set
			{
				bool flag = base.uiBehaviour.m_hardBox != null;
				if (flag)
				{
					base.uiBehaviour.m_hardBox.enabled = !value;
				}
				bool flag2 = base.uiBehaviour.m_normalBox != null;
				if (flag2)
				{
					base.uiBehaviour.m_normalBox.enabled = !value;
				}
				this.m_bLevelIsMoving = value;
			}
		}

		// Token: 0x17003AF4 RID: 15092
		// (get) Token: 0x06010D42 RID: 68930 RVA: 0x0043CEC4 File Offset: 0x0043B0C4
		public string EffectPath
		{
			get
			{
				bool flag = string.IsNullOrEmpty(this.m_effectPath);
				if (flag)
				{
					this.m_effectPath = XSingleton<XGlobalConfig>.singleton.GetValue("DungeonSelectRoleEffectPath");
				}
				return this.m_effectPath;
			}
		}

		// Token: 0x17003AF5 RID: 15093
		// (get) Token: 0x06010D43 RID: 68931 RVA: 0x0043CF00 File Offset: 0x0043B100
		public string EffectPath1
		{
			get
			{
				bool flag = string.IsNullOrEmpty(this.m_effectPath1);
				if (flag)
				{
					this.m_effectPath1 = XSingleton<XGlobalConfig>.singleton.GetValue("DungeonSelectRoleEffectPath1");
				}
				return this.m_effectPath1;
			}
		}

		// Token: 0x17003AF6 RID: 15094
		// (get) Token: 0x06010D44 RID: 68932 RVA: 0x0043CF3C File Offset: 0x0043B13C
		public override string fileName
		{
			get
			{
				return "Hall/DungeonSelect";
			}
		}

		// Token: 0x17003AF7 RID: 15095
		// (get) Token: 0x06010D45 RID: 68933 RVA: 0x0043CF54 File Offset: 0x0043B154
		public override int layer
		{
			get
			{
				return 1;
			}
		}

		// Token: 0x17003AF8 RID: 15096
		// (get) Token: 0x06010D46 RID: 68934 RVA: 0x0043CF68 File Offset: 0x0043B168
		public override bool pushstack
		{
			get
			{
				return true;
			}
		}

		// Token: 0x17003AF9 RID: 15097
		// (get) Token: 0x06010D47 RID: 68935 RVA: 0x0043CF7C File Offset: 0x0043B17C
		public override bool autoload
		{
			get
			{
				return true;
			}
		}

		// Token: 0x17003AFA RID: 15098
		// (get) Token: 0x06010D48 RID: 68936 RVA: 0x0043CF90 File Offset: 0x0043B190
		public override bool fullscreenui
		{
			get
			{
				return true;
			}
		}

		// Token: 0x17003AFB RID: 15099
		// (get) Token: 0x06010D49 RID: 68937 RVA: 0x0043CFA4 File Offset: 0x0043B1A4
		public override bool hideMainMenu
		{
			get
			{
				return true;
			}
		}

		// Token: 0x06010D4A RID: 68938 RVA: 0x0043CFB8 File Offset: 0x0043B1B8
		protected override void Init()
		{
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			this._welfareDoc = XDocuments.GetSpecificDocument<XWelfareDocument>(XWelfareDocument.uuID);
			bool flag = this._SelectedChapter == 0;
			if (flag)
			{
				this._SelectedChapter = XSingleton<XStageProgress>.singleton.GetPlayerLastChapter(this._SelectDifficult);
			}
			OpenSystemTable.RowData sysData = XSingleton<XGameSysMgr>.singleton.GetSysData(XSysDefineMgr.GetTypeInt(XSysDefine.XSys_Level_Elite));
			bool flag2 = sysData != null;
			if (flag2)
			{
				this._HardModeNeedLevel = sysData.PlayerLevel;
			}
			else
			{
				this._HardModeNeedLevel = 1;
				XSingleton<XDebug>.singleton.AddErrorLog("_sysData is nill", null, null, null, null, null);
			}
		}

		// Token: 0x06010D4B RID: 68939 RVA: 0x0043D05C File Offset: 0x0043B25C
		public GameObject GetGoLevelUpInfo()
		{
			return this.m_goLevelUpGo;
		}

		// Token: 0x06010D4C RID: 68940 RVA: 0x0043D074 File Offset: 0x0043B274
		public void FadeShow()
		{
			bool flag = !base.IsVisible();
			if (flag)
			{
				XAutoFade.FadeOut2In(0.5f, 0.5f);
				XSingleton<XTimerMgr>.singleton.SetTimer(0.484f, new XTimerMgr.ElapsedEventHandler(this.InnerShow), null);
			}
		}

		// Token: 0x06010D4D RID: 68941 RVA: 0x0043D0C0 File Offset: 0x0043B2C0
		private void InnerShow(object o)
		{
			this.SetVisible(true, true);
			XTaskDocument specificDocument = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
			specificDocument.ResetNavi();
		}

		// Token: 0x06010D4E RID: 68942 RVA: 0x0043D0EC File Offset: 0x0043B2EC
		protected override void OnShow()
		{
			base.OnShow();
			base.uiBehaviour.m_SceneDetail.SetActive(false);
			base.Alloc3DAvatarPool("DungeonSelect");
			XMainInterfaceDocument specificDocument = XDocuments.GetSpecificDocument<XMainInterfaceDocument>(XMainInterfaceDocument.uuID);
			specificDocument.OnTopUIRefreshed(this);
			XTaskDocument specificDocument2 = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
			bool isTaskMode = this.IsTaskMode;
			if (isTaskMode)
			{
				int naviScene = (int)specificDocument2.NaviScene;
				bool flag = naviScene != 0;
				if (flag)
				{
					this.SetAutoSelectScene(naviScene, 0, 0U);
					this._bAutoSelect = false;
					this._bAutoSelectChapterId = true;
				}
				this.IsTaskMode = false;
			}
			bool flag2 = DlgBase<XPurchaseView, XPurchaseBehaviour>.singleton.IsVisible();
			if (flag2)
			{
				DlgBase<XPurchaseView, XPurchaseBehaviour>.singleton.OnCloseClicked(null);
			}
			bool flag3 = DlgBase<XCharacterCommonMenuView, XCharacterCommonMenuBehaviour>.singleton.IsVisible();
			if (flag3)
			{
				DlgBase<XCharacterCommonMenuView, XCharacterCommonMenuBehaviour>.singleton.SetVisible(false, true);
			}
			bool flag4 = DlgBase<XOptionsView, XOptionsBehaviour>.singleton.IsVisible();
			if (flag4)
			{
				DlgBase<XOptionsView, XOptionsBehaviour>.singleton.SetVisible(false, true);
			}
			bool flag5 = DlgBase<XFlowerSendView, XFlowerSendBehaviour>.singleton.IsVisible();
			if (flag5)
			{
				DlgBase<XFlowerSendView, XFlowerSendBehaviour>.singleton.SetVisible(false, true);
			}
			bool flag6 = DlgBase<ScreenShotShareView, ScreenShotShareBehaviour>.singleton.IsLoaded() && DlgBase<ScreenShotShareView, ScreenShotShareBehaviour>.singleton.IsVisible();
			if (flag6)
			{
				DlgBase<ScreenShotShareView, ScreenShotShareBehaviour>.singleton.SetVisible(false, true);
			}
			bool flag7 = this._SelectDifficult == 0U;
			base.uiBehaviour.m_cbNormal.ForceSetFlag(false);
			base.uiBehaviour.m_cbHard.ForceSetFlag(false);
			bool bAutoSelect = this._bAutoSelect;
			if (bAutoSelect)
			{
				this.OnSwitchDifficult(flag7 ? base.uiBehaviour.m_Normal : base.uiBehaviour.m_Hard);
			}
			else
			{
				base.uiBehaviour.m_cbNormal.bChecked = flag7;
				base.uiBehaviour.m_cbHard.bChecked = !flag7;
				this.SetupChapterImage();
			}
			XTeamDocument specificDocument3 = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
			specificDocument3.ReqTeamOp(TeamOperate.TEAM_QUERYCOUNT, 0UL, null, TeamMemberType.TMT_NORMAL, null);
			XDailyActivitiesDocument specificDocument4 = XDocuments.GetSpecificDocument<XDailyActivitiesDocument>(XDailyActivitiesDocument.uuID);
			specificDocument4.QueryDailyActivityData();
		}

		// Token: 0x06010D4F RID: 68943 RVA: 0x0043D2DC File Offset: 0x0043B4DC
		private void ResetTexture(GameObject frame)
		{
			bool flag = frame != null;
			if (flag)
			{
				Transform transform = frame.transform.Find("BG");
				bool flag2 = transform != null;
				if (flag2)
				{
					IXUITexture ixuitexture = transform.GetComponent("XUITexture") as IXUITexture;
					ixuitexture.SetTexturePath("");
				}
			}
		}

		// Token: 0x06010D50 RID: 68944 RVA: 0x0043D334 File Offset: 0x0043B534
		protected override void OnHide()
		{
			base.OnHide();
			this.main.Clear();
			this.left.Clear();
			this.right.Clear();
			base.Return3DAvatarPool();
			this.bossDummy = null;
			XSingleton<XInput>.singleton.Freezed = false;
			this.ResetTexture(this._MainFrame);
			this.ResetTexture(this._LeftFrame);
			this.ResetTexture(this._RightFrame);
			this._bLevelIsMoving = false;
			base.uiBehaviour.m_LevelTween.StopTween();
			base.uiBehaviour.m_LevelTween.ResetTweenByGroup(true, 1);
			base.uiBehaviour.m_cbHard.ForceSetFlag(false);
			base.uiBehaviour.m_cbNormal.ForceSetFlag(false);
		}

		// Token: 0x06010D51 RID: 68945 RVA: 0x0043D400 File Offset: 0x0043B600
		protected override void OnUnload()
		{
			XSingleton<X3DAvatarMgr>.singleton.OnUIUnloadMainDummy(this.main.snapShot);
			base.Return3DAvatarPool();
			this.bossDummy = null;
			bool flag = this.m_fx != null;
			if (flag)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this.m_fx, true);
				this.m_fx = null;
			}
			bool flag2 = this.m_fx1 != null;
			if (flag2)
			{
				XSingleton<XFxMgr>.singleton.DestroyFx(this.m_fx1, true);
				this.m_fx1 = null;
			}
			base.OnUnload();
		}

		// Token: 0x06010D52 RID: 68946 RVA: 0x0043D48C File Offset: 0x0043B68C
		public override void RegisterEvent()
		{
			base.uiBehaviour.m_Normal.ID = 0UL;
			base.uiBehaviour.m_Hard.ID = 1UL;
			base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClicked));
			base.uiBehaviour.m_Normal.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSwitchDifficult));
			base.uiBehaviour.m_Hard.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSwitchDifficult));
			base.uiBehaviour.m_LevelBg.RegisterSpriteDragEventHandler(new SpriteDragEventHandler(this.OnLevelBgDrag));
			base.uiBehaviour.m_SceneClose.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnDetailClose));
			base.uiBehaviour.m_SceneQuick1.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnQuickClicked));
			base.uiBehaviour.m_SceneQuick10.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnQuickClicked));
			base.uiBehaviour.m_SceneGoBattle.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGoBattleBtnClicked));
			base.uiBehaviour.m_SceneSoloBattle.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSoloBattleClicked));
			base.uiBehaviour.m_SceneTeamBattle.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnTeamBattleClicked));
			base.uiBehaviour.m_ShopBtn.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnShopBtnClick));
			base.uiBehaviour.m_Left.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnMoveLeft));
			base.uiBehaviour.m_Right.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnMoveRight));
			base.uiBehaviour.m_BoxFrameBg.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnChapterBoxBgClick));
			base.uiBehaviour.m_BtnAddHardLeftCount0.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this._OnAddHardCountClicked));
			base.uiBehaviour.m_BtnAddHardLeftCount1.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this._OnAddHardCountClicked));
			base.uiBehaviour.m_PrerogativeBg.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnMemberPrivilegeClicked));
			base.uiBehaviour.m_addTicketSpr.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickAddTicketBtn));
		}

		// Token: 0x06010D53 RID: 68947 RVA: 0x0023F430 File Offset: 0x0023D630
		private void OnMemberPrivilegeClicked(IXUISprite btn)
		{
			DlgBase<XWelfareView, XWelfareBehaviour>.singleton.CheckActiveMemberPrivilege(MemberPrivilege.KingdomPrivilege_Adventurer);
		}

		// Token: 0x06010D54 RID: 68948 RVA: 0x0043D6CA File Offset: 0x0043B8CA
		private void OnClickAddTicketBtn(IXUISprite spr)
		{
			XSingleton<UiUtility>.singleton.ShowItemAccess(XSingleton<XGlobalConfig>.singleton.GetInt("SweepTicketId"), null);
		}

		// Token: 0x06010D55 RID: 68949 RVA: 0x0043D6E8 File Offset: 0x0043B8E8
		protected void OnSwitchDifficult(IXUISprite sp)
		{
			bool bLevelIsMoving = this._bLevelIsMoving;
			if (!bLevelIsMoving)
			{
				uint num = (uint)sp.ID;
				bool flag = this._IsHardModeEnable();
				bool flag2 = 1U == num;
				if (flag2)
				{
					bool flag3 = !flag;
					if (flag3)
					{
						base.uiBehaviour.m_cbHard.bChecked = false;
						base.uiBehaviour.m_cbNormal.bChecked = true;
						XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("DUNGEONSELECT_HARDMODE_LEVEL_LIMIT_FMT", new object[]
						{
							this._HardModeNeedLevel
						}), "fece00");
						return;
					}
				}
				else
				{
					bool flag4 = !XSingleton<XGameSysMgr>.singleton.IsSystemOpened(XSysDefine.XSys_Level_Normal);
					if (flag4)
					{
						return;
					}
				}
				base.uiBehaviour.m_cbHard.bChecked = (1U == num);
				base.uiBehaviour.m_cbNormal.bChecked = (1U != num);
				bool bAutoSelectChapterId = this._bAutoSelectChapterId;
				if (bAutoSelectChapterId)
				{
					int playerLocationChapter = XSingleton<XStageProgress>.singleton.GetPlayerLocationChapter(num);
					this._SelectedChapter = playerLocationChapter;
				}
				else
				{
					this._bAutoSelectChapterId = true;
				}
				this._SelectDifficult = num;
				this.SetupChapterImage();
				XSingleton<XDebug>.singleton.AddGreenLog("OnSwitchDifficult", null, null, null, null, null);
			}
		}

		// Token: 0x06010D56 RID: 68950 RVA: 0x0043D818 File Offset: 0x0043BA18
		private bool _IsHardModeEnable()
		{
			bool flag = XSingleton<XAttributeMgr>.singleton.XPlayerData != null;
			bool result;
			if (flag)
			{
				result = ((long)this._HardModeNeedLevel <= (long)((ulong)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level));
			}
			else
			{
				XSingleton<XDebug>.singleton.AddGreenLog("XAttributeMgr.singleton.XPlayerData is null", null, null, null, null, null);
				result = false;
			}
			return result;
		}

		// Token: 0x06010D57 RID: 68951 RVA: 0x0043D874 File Offset: 0x0043BA74
		public void AutoShowLastChapter(uint difficult, bool showDetailFrame = true)
		{
			bool flag = 1U == difficult && !this._IsHardModeEnable();
			if (flag)
			{
				difficult = 0U;
			}
			this._SelectDifficult = difficult;
			this._SelectedChapter = XSingleton<XStageProgress>.singleton.GetPlayerLocationChapter(this._SelectDifficult);
			this._SelectScene = XSingleton<XStageProgress>.singleton.GetPlayerLastSceneInChapter(this._SelectedChapter);
			bool flag2 = this._SelectDifficult == 0U;
			if (flag2)
			{
				this.OnSwitchDifficult(base.uiBehaviour.m_Normal);
			}
			else
			{
				this.OnSwitchDifficult(base.uiBehaviour.m_Hard);
			}
			bool flag3 = this._SelectScene > 0U && showDetailFrame;
			if (flag3)
			{
				this._SetupDetailFrame(this._SelectScene);
			}
		}

		// Token: 0x06010D58 RID: 68952 RVA: 0x0043D920 File Offset: 0x0043BB20
		protected bool OnQuickClicked(IXUIButton button)
		{
			bool flag = this.SetButtonCool(this.m_fSweepBtnCoolTime);
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				bool flag2 = XSingleton<XGameSysMgr>.singleton.IsSystemOpened(XSysDefine.XSys_Level_Swap);
				bool flag3 = !flag2;
				if (flag3)
				{
					XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("SWAP_NOT_OPEN"), "fece00");
					result = true;
				}
				else
				{
					bool flag4 = this._SelectDifficult == 1U;
					if (flag4)
					{
						XMainInterfaceDocument xmainInterfaceDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XMainInterfaceDocument.uuID) as XMainInterfaceDocument;
						SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(this._SelectScene);
						bool flag5 = sceneData != null && xmainInterfaceDocument != null && xmainInterfaceDocument.GetPlayerPPT() < sceneData.SweepNeedPPT;
						if (flag5)
						{
							XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("SWEEPPPT_NOTENOUGH"), "fece00");
							return true;
						}
						bool flag6 = XSingleton<XGame>.singleton.Doc.XBagDoc.GetItemCount(87) <= 0UL;
						if (flag6)
						{
							XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("SWEEPTICKETS_NOTENOUGH"), "fece00");
							return true;
						}
						XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
						int expIDBySceneID = specificDocument.GetExpIDBySceneID(this._SelectScene);
						bool flag7 = !specificDocument.CheckCountAndBuy(expIDBySceneID, sceneData);
						if (flag7)
						{
							return true;
						}
					}
					bool flag8 = this.OnLackPower();
					if (flag8)
					{
						result = true;
					}
					else
					{
						bool flag9 = this._SelectScene > 0U;
						if (flag9)
						{
							XSweepDocument specificDocument2 = XDocuments.GetSpecificDocument<XSweepDocument>(XSweepDocument.uuID);
							bool flag10 = button.gameObject.name == "Quick1";
							if (flag10)
							{
								specificDocument2.StartSweep(this._SelectScene, 1U);
							}
							else
							{
								bool flag11 = button.gameObject.name == "Quick10";
								if (flag11)
								{
									bool flag12 = this._SelectDifficult == 0U;
									if (flag12)
									{
										specificDocument2.StartSweep(this._SelectScene, 10U);
									}
									else
									{
										bool flag13 = this._SelectDifficult == 1U;
										if (flag13)
										{
											specificDocument2.StartSweep(this._SelectScene, 5U);
										}
									}
								}
							}
						}
						result = true;
					}
				}
			}
			return result;
		}

		// Token: 0x06010D59 RID: 68953 RVA: 0x0043DB40 File Offset: 0x0043BD40
		private bool SetButtonCool(float time)
		{
			float num = Time.realtimeSinceStartup - this.m_fLastClickBtnTime;
			bool flag = num < time;
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				this.m_fLastClickBtnTime = Time.realtimeSinceStartup;
				result = false;
			}
			return result;
		}

		// Token: 0x06010D5A RID: 68954 RVA: 0x0043DB78 File Offset: 0x0043BD78
		protected bool OnCloseClicked(IXUIButton button)
		{
			bool bLevelIsMoving = this._bLevelIsMoving;
			bool result;
			if (bLevelIsMoving)
			{
				XSingleton<XDebug>.singleton.AddLog("isMoving!!!!", null, null, null, null, null, XDebugColor.XDebug_None);
				result = true;
			}
			else
			{
				this.SetVisible(false, true);
				result = true;
			}
			return result;
		}

		// Token: 0x06010D5B RID: 68955 RVA: 0x0043DBBC File Offset: 0x0043BDBC
		protected bool OnResetClicked(IXUIButton button)
		{
			int num = 0;
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			bool flag = xlevelDocument.SceneBuyCount.ContainsKey(this._SelectScene);
			if (flag)
			{
				num = (int)xlevelDocument.SceneBuyCount[this._SelectScene];
			}
			List<uint> list = ListPool<uint>.Get();
			string[] array = XSingleton<XGlobalConfig>.singleton.GetValue("BuyStageCountCost").Split(XGlobalConfig.ListSeparator);
			uint num2 = 0U;
			while ((ulong)num2 < (ulong)((long)array.Length))
			{
				list.Add(uint.Parse(array[(int)num2]));
				num2 += 1U;
			}
			bool flag2 = num >= list.Count;
			if (flag2)
			{
				num = list.Count - 1;
			}
			uint num3 = list[num];
			string label = string.Format(XStringDefineProxy.GetString("RESET_LEVEL"), num3);
			XSingleton<UiUtility>.singleton.ShowModalDialog(label, XStringDefineProxy.GetString("COMMON_OK"), XStringDefineProxy.GetString("COMMON_CANCEL"), new ButtonClickEventHandler(this._ResetScene));
			ListPool<uint>.Release(list);
			return true;
		}

		// Token: 0x06010D5C RID: 68956 RVA: 0x0043DCD4 File Offset: 0x0043BED4
		protected bool _ResetScene(IXUIButton button)
		{
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			xlevelDocument.ResetScene((int)this._SelectScene);
			XSingleton<UiUtility>.singleton.CloseModalDlg();
			return true;
		}

		// Token: 0x06010D5D RID: 68957 RVA: 0x0043DD19 File Offset: 0x0043BF19
		public void OnResetSucc()
		{
			this._SetupDetailFrame(this._SelectScene);
		}

		// Token: 0x06010D5E RID: 68958 RVA: 0x0043DD2C File Offset: 0x0043BF2C
		public bool OnGoBattleBtnClicked(IXUIButton go)
		{
			bool flag = this._SelectScene > 0U;
			if (flag)
			{
				bool flag2 = this.OnLackPower();
				if (flag2)
				{
					return true;
				}
				SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(this._SelectScene);
				bool flag3 = sceneData == null;
				if (flag3)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("sceneData is null", null, null, null, null, null);
					return true;
				}
				float num = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("SceneGotoPower"));
				bool flag4 = XSingleton<PPTCheckMgr>.singleton.CheckMyPPT(Mathf.FloorToInt((float)sceneData.RecommendPower * num));
				if (flag4)
				{
					this.GoBattle(null);
				}
				else
				{
					base.uiBehaviour.m_SceneDetail.gameObject.SetActive(false);
					XSingleton<PPTCheckMgr>.singleton.ShowPPTNotEnoughDlg(0UL, new ButtonClickEventHandler(this.GoBattle));
				}
			}
			return true;
		}

		// Token: 0x06010D5F RID: 68959 RVA: 0x0043DE0C File Offset: 0x0043C00C
		public bool OnSoloBattleClicked(IXUIButton go)
		{
			bool flag = this._SelectDifficult == 1U;
			if (flag)
			{
				SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(this._SelectScene);
				bool flag2 = sceneData == null;
				if (flag2)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("sceneData is null", null, null, null, null, null);
					return true;
				}
				float num = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("SceneGotoPower"));
				bool flag3 = XSingleton<PPTCheckMgr>.singleton.CheckMyPPT(Mathf.FloorToInt((float)sceneData.RecommendPower * num));
				if (flag3)
				{
					this.OnRealSoloBattleClicked(null);
				}
				else
				{
					base.uiBehaviour.m_SceneDetail.gameObject.SetActive(false);
					XSingleton<PPTCheckMgr>.singleton.ShowPPTNotEnoughDlg(0UL, new ButtonClickEventHandler(this.OnRealSoloBattleClicked));
				}
			}
			return true;
		}

		// Token: 0x06010D60 RID: 68960 RVA: 0x0043DED8 File Offset: 0x0043C0D8
		public bool OnRealSoloBattleClicked(IXUIButton go)
		{
			bool flag = this.OnLackPower();
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				XTeamDocument specificDocument = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
				bool bInTeam = specificDocument.bInTeam;
				if (bInTeam)
				{
					XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_TEAM_ALREADY_INTEAM"), "fece00");
					result = true;
				}
				else
				{
					result = true;
				}
			}
			return result;
		}

		// Token: 0x06010D61 RID: 68961 RVA: 0x0043DF30 File Offset: 0x0043C130
		public bool OnTeamBattleClicked(IXUIButton go)
		{
			bool flag = this._SelectDifficult == 1U;
			if (flag)
			{
				SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(this._SelectScene);
				float num = float.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("SceneGotoPower"));
				bool flag2 = sceneData != null;
				if (flag2)
				{
					bool flag3 = XSingleton<PPTCheckMgr>.singleton.CheckMyPPT(Mathf.FloorToInt((float)sceneData.RecommendPower * num));
					if (flag3)
					{
						this.OnRealTeamBattleClicked(null);
					}
					else
					{
						base.uiBehaviour.m_SceneDetail.gameObject.SetActive(false);
						XSingleton<PPTCheckMgr>.singleton.ShowPPTNotEnoughDlg(0UL, new ButtonClickEventHandler(this.OnRealTeamBattleClicked));
					}
				}
			}
			return true;
		}

		// Token: 0x06010D62 RID: 68962 RVA: 0x0043DFE4 File Offset: 0x0043C1E4
		public bool OnRealTeamBattleClicked(IXUIButton go)
		{
			XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
			XTeamDocument specificDocument2 = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
			int expIDBySceneID = specificDocument.GetExpIDBySceneID(this._SelectScene);
			specificDocument2.SetAndMatch(expIDBySceneID);
			return true;
		}

		// Token: 0x06010D63 RID: 68963 RVA: 0x0043E024 File Offset: 0x0043C224
		private bool OnLackPower()
		{
			return this.OnLackPower(1);
		}

		// Token: 0x06010D64 RID: 68964 RVA: 0x0043E040 File Offset: 0x0043C240
		private bool OnLackPower(int times)
		{
			bool flag = !XSingleton<UiUtility>.singleton.CanEnterBattleScene(this._SelectScene, times);
			bool result;
			if (flag)
			{
				bool flag2 = XSingleton<UiUtility>.singleton.IsMaxBuyPowerCnt();
				if (flag2)
				{
					XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("ERR_SCENE_NOFATIGUE"), "fece00");
				}
				else
				{
					DlgBase<XPurchaseView, XPurchaseBehaviour>.singleton.ShowBorad(ItemEnum.FATIGUE);
				}
				result = true;
			}
			else
			{
				result = false;
			}
			return result;
		}

		// Token: 0x06010D65 RID: 68965 RVA: 0x0043E0AC File Offset: 0x0043C2AC
		protected bool GoBattle(IXUIButton go)
		{
			DlgBase<ModalDlg, ModalDlgBehaviour>.singleton.SetVisible(false, true);
			bool flag = XTeamDocument.GoSingleBattleBeforeNeed(new ButtonClickEventHandler(this.GoBattle), go);
			bool result;
			if (flag)
			{
				result = true;
			}
			else
			{
				bool flag2 = this.SetButtonCool(this.m_fGoBattleCoolTime);
				if (flag2)
				{
					result = true;
				}
				else
				{
					PtcC2G_EnterSceneReq ptcC2G_EnterSceneReq = new PtcC2G_EnterSceneReq();
					ptcC2G_EnterSceneReq.Data.sceneID = this._SelectScene;
					XSingleton<XClientNetwork>.singleton.Send(ptcC2G_EnterSceneReq);
					result = true;
				}
			}
			return result;
		}

		// Token: 0x06010D66 RID: 68966 RVA: 0x0043E120 File Offset: 0x0043C320
		public void SetAutoSelectScene(int sceneid, int chapterid, uint diff)
		{
			this._bAutoSelectChapterId = false;
			bool flag = sceneid == 0;
			if (flag)
			{
				this._SelectDifficult = diff;
				this._SelectedChapter = chapterid;
				this._SelectScene = 0U;
				bool flag2 = this._SelectedChapter == 0;
				if (flag2)
				{
					this._SelectedChapter = XSingleton<XStageProgress>.singleton.GetPlayerLocationChapter(this._SelectDifficult);
				}
				this._bAutoSelect = true;
			}
			else
			{
				this._SelectScene = (uint)sceneid;
				this._SelectedChapter = XSingleton<XSceneMgr>.singleton.GetSceneChapter(sceneid);
				this._SelectDifficult = (uint)XSingleton<XSceneMgr>.singleton.GetSceneDifficult(sceneid);
				this._bAutoSelect = true;
			}
		}

		// Token: 0x06010D67 RID: 68967 RVA: 0x0043E1AF File Offset: 0x0043C3AF
		public void SelectChapter(int chapterid, uint diff)
		{
			this._SelectScene = 0U;
			this._SelectedChapter = chapterid;
			this._SelectDifficult = diff;
			this.FadeShow();
		}

		// Token: 0x06010D68 RID: 68968 RVA: 0x0043E1D0 File Offset: 0x0043C3D0
		protected GameObject GetLevelFrame()
		{
			return base.uiBehaviour.m_SceneFramePool.FetchGameObject(false);
		}

		// Token: 0x06010D69 RID: 68969 RVA: 0x0043E1F4 File Offset: 0x0043C3F4
		protected void SetupChapterBaseImage(int chapter, uint difficult, GameObject frame)
		{
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			XChapter.RowData chapter2 = XSingleton<XSceneMgr>.singleton.GetChapter(chapter);
			IXUILabel ixuilabel = frame.transform.Find("Title").GetComponent("XUILabel") as IXUILabel;
			bool flag = chapter2 != null;
			if (flag)
			{
				ixuilabel.SetText(chapter2.Comment);
			}
			Transform transform = frame.transform.Find("me");
			IXUISprite ixuisprite = frame.transform.Find("me/me/me").GetComponent("XUISprite") as IXUISprite;
			ixuisprite.spriteName = XSingleton<XProfessionSkillMgr>.singleton.GetSuperRiskAvatar(XSingleton<XEntityMgr>.singleton.Player.BasicTypeID);
			ixuisprite.MakePixelPerfect();
			transform.gameObject.SetActive(false);
			Transform transform2 = frame.transform.Find("BG");
			bool flag2 = transform2 != null;
			if (flag2)
			{
				IXUITexture ixuitexture = transform2.GetComponent("XUITexture") as IXUITexture;
				bool flag3 = chapter2 != null;
				if (flag3)
				{
					ixuitexture.SetTexturePath("atlas/UI/Hall/LevelBg/" + chapter2.Pic);
				}
			}
			List<uint> list = ListPool<uint>.Get();
			XSingleton<XSceneMgr>.singleton.GetSceneListByChapter(chapter, list);
			bool flag4 = list.Count == 0;
			if (flag4)
			{
				ListPool<uint>.Release(list);
			}
			else
			{
				list.Sort();
				bool flag5 = difficult == 0U;
				if (flag5)
				{
					base.uiBehaviour.m_NormalBg.SetActive(true);
					base.uiBehaviour.m_HardBg.SetActive(false);
					base.uiBehaviour.m_HardLeftCountGo0.SetActive(false);
					base.uiBehaviour.m_ShopBtn.SetVisible(false);
				}
				else
				{
					base.uiBehaviour.m_PrerogativeSpr.SetGrey(this._welfareDoc.IsOwnMemberPrivilege(MemberPrivilege.KingdomPrivilege_Adventurer));
					base.uiBehaviour.m_PrerogativeSpr.SetSprite(this._welfareDoc.GetMemberPrivilegeIcon(MemberPrivilege.KingdomPrivilege_Adventurer));
					base.uiBehaviour.m_PrerogativeLab.SetEnabled(this._welfareDoc.IsOwnMemberPrivilege(MemberPrivilege.KingdomPrivilege_Adventurer));
					base.uiBehaviour.m_PrerogativeLab.SetText(string.Format(XStringDefineProxy.GetString("Prerogative_Abyss"), this._welfareDoc.GetMemberPrivilegeConfig(MemberPrivilege.KingdomPrivilege_Adventurer).AbyssCount));
					base.uiBehaviour.m_NormalBg.SetActive(false);
					base.uiBehaviour.m_HardBg.SetActive(true);
					base.uiBehaviour.m_HardLeftCountGo0.SetActive(true);
					base.uiBehaviour.m_ShopBtn.SetVisible(true);
				}
				bool flag6 = false;
				GameObject fx = null;
				Transform parent = frame.transform.Find("Levels");
				XSingleton<X3DAvatarMgr>.singleton.ClearDummy(this.m_dummPool);
				this.bossDummy = null;
				bool flag7 = frame == this._MainFrame;
				if (flag7)
				{
					this._isShowBossAvatar = true;
				}
				for (int i = 0; i < list.Count; i++)
				{
					uint num = list[i];
					SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(num);
					int num2 = XSingleton<XStageProgress>.singleton.GetRank(sceneData.id);
					bool flag8 = num2 == -1;
					if (flag8)
					{
						num2 = 0;
					}
					bool flag9 = sceneData != null;
					if (flag9)
					{
						GameObject gameObject = base.uiBehaviour.m_ScenePool.FetchGameObject(false);
						gameObject.name = sceneData.id.ToString();
						gameObject.transform.parent = parent;
						bool flag10 = sceneData.UIPos != null;
						if (flag10)
						{
							gameObject.transform.localPosition = new Vector3((float)sceneData.UIPos[0], (float)sceneData.UIPos[1], 600f);
						}
						else
						{
							XSingleton<XDebug>.singleton.AddErrorLog("'uipos' is null,To the plotter(ce hua) Find a solution,please,sceneId = " + num.ToString(), null, null, null, null, null);
						}
						gameObject.transform.localScale = Vector3.one;
						this.SceneDic[num] = gameObject;
						IXUISprite ixuisprite2 = gameObject.transform.Find("SprBtn").GetComponent("XUISprite") as IXUISprite;
						ixuisprite2.ID = (ulong)sceneData.id;
						ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSceneSelected));
						IXUISprite ixuisprite3 = gameObject.transform.Find("LevelPic").GetComponent("XUISprite") as IXUISprite;
						IXUISprite ixuisprite4 = gameObject.transform.Find("Star1").GetComponent("XUISprite") as IXUISprite;
						IXUISprite ixuisprite5 = gameObject.transform.Find("Star2").GetComponent("XUISprite") as IXUISprite;
						IXUISprite ixuisprite6 = gameObject.transform.Find("Star3").GetComponent("XUISprite") as IXUISprite;
						GameObject gameObject2 = gameObject.transform.Find("TaskHint").gameObject;
						Transform transform3 = gameObject.transform.Find("Snapshot");
						IXUISprite ixuisprite7 = gameObject.transform.Find("Box").GetComponent("XUISprite") as IXUISprite;
						IXUILabel ixuilabel2 = gameObject.transform.Find("Hint").GetComponent("XUILabel") as IXUILabel;
						IXUILabel ixuilabel3 = gameObject.transform.Find("Hint/GoLevelup").GetComponent("XUILabel") as IXUILabel;
						IXUISprite ixuisprite8 = gameObject.transform.Find("BoxFx").GetComponent("XUISprite") as IXUISprite;
						ixuisprite7.gameObject.SetActive(false);
						ixuilabel2.gameObject.SetActive(false);
						ixuisprite8.gameObject.SetActive(false);
						XTaskDocument specificDocument = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
						gameObject2.SetActive(specificDocument.GetSceneTaskState(num).Count > 0);
						bool flag11 = difficult == 0U;
						if (flag11)
						{
							ixuisprite3.SetSprite("gk_0");
						}
						else
						{
							ixuisprite3.SetSprite("gk_1");
						}
						ixuisprite4.gameObject.SetActive(true);
						ixuisprite4.spriteName = "gk_3";
						ixuisprite5.gameObject.SetActive(true);
						ixuisprite5.spriteName = "gk_3";
						ixuisprite6.gameObject.SetActive(true);
						ixuisprite6.spriteName = "gk_3";
						bool flag12 = num2 >= 1;
						if (flag12)
						{
							ixuisprite4.spriteName = "gk_4";
						}
						bool flag13 = num2 >= 2;
						if (flag13)
						{
							ixuisprite5.spriteName = "gk_4";
						}
						bool flag14 = num2 >= 3;
						if (flag14)
						{
							ixuisprite6.spriteName = "gk_4";
						}
						bool flag15 = num2 == 0;
						if (flag15)
						{
							ixuisprite4.gameObject.SetActive(false);
							ixuisprite5.gameObject.SetActive(false);
							ixuisprite6.gameObject.SetActive(false);
						}
						ixuisprite3.SetGrey(!flag6);
						bool flag16 = num2 <= 0;
						if (flag16)
						{
							SceneRefuseReason sceneRefuseReason = SceneRefuseReason.Invalid;
							bool flag17 = !flag6;
							if (flag17)
							{
								sceneRefuseReason = xlevelDocument.CanLevelOpen(num);
								ixuisprite3.SetGrey(true);
								transform.localPosition = gameObject.transform.localPosition;
								fx = transform.gameObject;
								bool flag18 = i == list.Count - 1;
								if (flag18)
								{
									this._isShowBossAvatar = false;
								}
								bool flag19 = sceneRefuseReason != SceneRefuseReason.Admit;
								if (flag19)
								{
									ixuilabel2.gameObject.SetActive(true);
									bool flag20 = sceneRefuseReason == SceneRefuseReason.PreTask_Notfinish;
									if (flag20)
									{
										ixuilabel3.SetText(XStringDefineProxy.GetString("LEVEL_GO_TASK"));
										ixuilabel2.SetText(string.Format(XStringDefineProxy.GetString("LEVEl_REQUIRE_TASK"), new object[0]));
										ixuilabel3.RegisterLabelClickEventHandler(new LabelClickEventHandler(this.OnGoLevelupClick));
									}
									else
									{
										bool flag21 = sceneRefuseReason == SceneRefuseReason.PreScene_Notfinish;
										if (flag21)
										{
											ixuilabel3.SetText(XStringDefineProxy.GetString("LEVEL_GO_SCENE"));
											int unFinishedPreSceneID = xlevelDocument.GetUnFinishedPreSceneID(sceneData);
											SceneTable.RowData sceneData2 = XSingleton<XSceneMgr>.singleton.GetSceneData((uint)unFinishedPreSceneID);
											bool flag22 = sceneData2 != null;
											if (flag22)
											{
												ixuilabel2.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_PRELEVEL"), sceneData2.Comment));
											}
											ixuilabel3.RegisterLabelClickEventHandler(new LabelClickEventHandler(this.OnGoLevelupClick));
										}
										else
										{
											bool flag23 = SceneRefuseReason.ReachLimitTimes == sceneRefuseReason;
											if (flag23)
											{
												ixuilabel3.SetText(XStringDefineProxy.GetString("LEVEL_REACH_LIMIT_TIMES"));
												ixuilabel2.SetText(XStringDefineProxy.GetString("LEVEL_REACH_LIMIT_TIMES"));
												ixuilabel3.RegisterLabelClickEventHandler(new LabelClickEventHandler(this.OnGoLevelupClick));
											}
											else
											{
												ixuilabel3.SetText(XStringDefineProxy.GetString("LEVEL_GO_UP"));
												ixuilabel2.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_LEVEL"), sceneData.RequiredLevel));
												this.m_goLevelUpGo = ixuilabel2.gameObject;
												XSingleton<XDebug>.singleton.AddGreenLog("get farme", null, null, null, null, null);
											}
										}
									}
									ixuilabel3.ID = (ulong)sceneData.id;
								}
							}
							bool flag24 = sceneRefuseReason == SceneRefuseReason.Admit;
							if (flag24)
							{
								transform.localPosition = gameObject.transform.localPosition;
								fx = transform.gameObject;
							}
							flag6 = true;
						}
						else
						{
							transform.localPosition = gameObject.transform.localPosition;
							fx = transform.gameObject;
						}
						bool flag25 = sceneData.SceneChest != 0 && sceneData.BoxUIPos != null && sceneData.BoxUIPos.Length == 2;
						if (flag25)
						{
							GameObject gameObject3 = base.uiBehaviour.m_ScenePool.FetchGameObject(false);
							gameObject3.name = "chest" + num;
							gameObject3.transform.parent = parent;
							gameObject3.transform.localPosition = new Vector3((float)sceneData.BoxUIPos[0], (float)sceneData.BoxUIPos[1], 600f);
							gameObject3.transform.localScale = Vector3.one;
							this.SetupLevelChest(gameObject3, num, sceneData.SceneChest, num2);
						}
					}
				}
				ListPool<uint>.Release(list);
				bool flag26 = frame == this._MainFrame;
				if (flag26)
				{
					this.main.fx = fx;
				}
				else
				{
					bool flag27 = frame == this._LeftFrame;
					if (flag27)
					{
						this.left.fx = fx;
					}
					else
					{
						bool flag28 = frame == this._RightFrame;
						if (flag28)
						{
							this.right.fx = fx;
						}
					}
				}
			}
		}

		// Token: 0x06010D6A RID: 68970 RVA: 0x0043EC58 File Offset: 0x0043CE58
		protected void OnGoLevelupClick(IXUILabel go)
		{
			uint sceneID = (uint)go.ID;
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			switch (xlevelDocument.CanLevelOpen(sceneID))
			{
			case SceneRefuseReason.PreTask_Notfinish:
			{
				XTaskDocument specificDocument = XDocuments.GetSpecificDocument<XTaskDocument>(XTaskDocument.uuID);
				XTaskInfo mainTask = specificDocument.TaskRecord.MainTask;
				bool flag = mainTask != null;
				if (flag)
				{
					uint sceneID2 = XTaskDocument.GetSceneID(ref mainTask.TableData.PassScene);
					bool flag2 = mainTask.Status == TaskStatus.TaskStatus_Taked && sceneID2 > 0U;
					if (flag2)
					{
						this._SelectedChapter = XSingleton<XSceneMgr>.singleton.GetSceneChapter((int)sceneID2);
						this._SelectDifficult = (uint)XSingleton<XSceneMgr>.singleton.GetSceneDifficult((int)sceneID2);
						this._SelectScene = sceneID2;
						this._SetupDetailFrame(sceneID2);
					}
					else
					{
						this.SetVisible(false, true);
						specificDocument.DoTask(mainTask.ID);
					}
				}
				break;
			}
			case SceneRefuseReason.PreScene_Notfinish:
			{
				SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(sceneID);
				bool flag3 = sceneData == null;
				if (flag3)
				{
					XSingleton<XDebug>.singleton.AddGreenLog("scenedata is null", null, null, null, null, null);
				}
				else
				{
					int unFinishedPreSceneID = xlevelDocument.GetUnFinishedPreSceneID(sceneData);
					int rank = XSingleton<XStageProgress>.singleton.GetRank(unFinishedPreSceneID);
					bool flag4 = rank > 0 || xlevelDocument.CanLevelOpen((uint)unFinishedPreSceneID) == SceneRefuseReason.Admit;
					if (flag4)
					{
						this._SelectScene = (uint)unFinishedPreSceneID;
						int sceneChapter = XSingleton<XSceneMgr>.singleton.GetSceneChapter(unFinishedPreSceneID);
						int sceneDifficult = XSingleton<XSceneMgr>.singleton.GetSceneDifficult(unFinishedPreSceneID);
						bool flag5 = sceneChapter != this._SelectedChapter || (long)sceneDifficult != (long)((ulong)this._SelectDifficult);
						if (flag5)
						{
							base.uiBehaviour.m_cbNormal.ForceSetFlag(false);
							base.uiBehaviour.m_cbHard.ForceSetFlag(false);
							bool flag6 = sceneDifficult == 0;
							if (flag6)
							{
								base.uiBehaviour.m_cbNormal.bChecked = true;
								this.OnSwitchDifficult(base.uiBehaviour.m_Normal);
							}
							else
							{
								base.uiBehaviour.m_cbHard.bChecked = true;
								this.OnSwitchDifficult(base.uiBehaviour.m_Hard);
							}
							this._SelectDifficult = (uint)sceneDifficult;
							this._SelectedChapter = sceneChapter;
						}
						this._SetupDetailFrame((uint)unFinishedPreSceneID);
					}
					else
					{
						int sceneChapter2 = XSingleton<XSceneMgr>.singleton.GetSceneChapter(unFinishedPreSceneID);
						int sceneDifficult2 = XSingleton<XSceneMgr>.singleton.GetSceneDifficult(unFinishedPreSceneID);
						bool flag7 = sceneChapter2 != this._SelectedChapter || (long)sceneDifficult2 != (long)((ulong)this._SelectDifficult);
						if (flag7)
						{
							IXUICheckBox ixuicheckBox = base.uiBehaviour.m_Normal.gameObject.GetComponent("XUICheckBox") as IXUICheckBox;
							IXUICheckBox ixuicheckBox2 = base.uiBehaviour.m_Hard.gameObject.GetComponent("XUICheckBox") as IXUICheckBox;
							ixuicheckBox.bChecked = false;
							ixuicheckBox2.bChecked = false;
							bool flag8 = sceneDifficult2 == 0;
							if (flag8)
							{
								ixuicheckBox.bChecked = true;
								this.OnSwitchDifficult(base.uiBehaviour.m_Normal);
							}
							else
							{
								ixuicheckBox2.bChecked = true;
								this.OnSwitchDifficult(base.uiBehaviour.m_Hard);
							}
							this._SelectDifficult = (uint)sceneDifficult2;
							this._SelectedChapter = sceneChapter2;
						}
					}
				}
				break;
			}
			}
		}

		// Token: 0x06010D6B RID: 68971 RVA: 0x0043EFA4 File Offset: 0x0043D1A4
		protected void SetupBossAvatar(int chapter, uint difficult, GameObject frame)
		{
			bool flag = this.bossDummy != null;
			if (flag)
			{
				XSingleton<X3DAvatarMgr>.singleton.EnableCommonDummy(this.bossDummy, null, false);
			}
			List<uint> list = ListPool<uint>.Get();
			XSingleton<XSceneMgr>.singleton.GetSceneListByChapter(chapter, list);
			bool flag2 = list.Count == 0;
			if (flag2)
			{
				ListPool<uint>.Release(list);
			}
			else
			{
				list.Sort();
				bool flag3 = list.Count == 0;
				if (!flag3)
				{
					uint sceneID = list[list.Count - 1];
					bool flag4 = !this._isShowBossAvatar;
					if (!flag4)
					{
						int rank = XSingleton<XStageProgress>.singleton.GetRank((int)sceneID);
						bool flag5 = rank >= 0;
						if (flag5)
						{
							ListPool<uint>.Release(list);
						}
						else
						{
							bool flag6 = rank < 0 && list.Count > 1;
							if (flag6)
							{
								bool flag7 = list.Count < 2;
								if (flag7)
								{
									return;
								}
								XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
								uint sceneID2 = list[list.Count - 2];
								int rank2 = XSingleton<XStageProgress>.singleton.GetRank((int)sceneID2);
								bool flag8 = rank2 > 0 && xlevelDocument.CanLevelOpen(sceneID) == SceneRefuseReason.Admit;
								if (flag8)
								{
									ListPool<uint>.Release(list);
									return;
								}
							}
							ListPool<uint>.Release(list);
							Transform transform = frame.transform.Find("Levels");
							Transform child = transform.GetChild(transform.childCount - 1);
							bool flag9 = child.gameObject.name.StartsWith("chest");
							if (flag9)
							{
								child = transform.GetChild(transform.childCount - 2);
							}
							IUIDummy iuidummy = child.Find("Snapshot").GetComponent("UIDummy") as IUIDummy;
							Vector3 localPosition = iuidummy.transform.localPosition;
							localPosition.z = -100f;
							iuidummy.transform.localPosition = localPosition;
							XChapter.RowData chapter2 = XSingleton<XSceneMgr>.singleton.GetChapter(chapter);
							bool flag10 = chapter2 != null;
							if (flag10)
							{
								XEntityStatistics.RowData byID = XSingleton<XEntityMgr>.singleton.EntityStatistics.GetByID((uint)chapter2.BossID);
								bool flag11 = byID == null;
								if (!flag11)
								{
									this.bossDummy = XSingleton<X3DAvatarMgr>.singleton.CreateCommonEntityDummy(this.m_dummPool, byID.PresentID, iuidummy, this.bossDummy, 1f);
								}
							}
							else
							{
								XSingleton<XDebug>.singleton.AddErrorLog(string.Format("error chapterId = {0}", chapter), null, null, null, null, null);
							}
						}
					}
				}
			}
		}

		// Token: 0x06010D6C RID: 68972 RVA: 0x0043F21C File Offset: 0x0043D41C
		public void SetupChapterImage()
		{
			base.uiBehaviour.m_ScenePool.ReturnAll(true);
			base.uiBehaviour.m_SceneFramePool.ReturnAll(false);
			this.SceneDic.Clear();
			this._MainFrame = null;
			this._LeftFrame = null;
			this._RightFrame = null;
			this._bLevelIsMoving = false;
			this._MainFrame = this.GetLevelFrame();
			base.uiBehaviour.m_LevelTween.gameObject.transform.Find("LevelFramePanel").localPosition = Vector3.zero;
			this._MainFrame.transform.localPosition = Vector3.zero;
			this._MainFrame.name = string.Format("chapter{0}", this._SelectedChapter);
			this._ChapterRank = 0;
			this._ChapterTotalRank = 0;
			this._FirstNoRankScene = 0U;
			this.SetupChapterBaseImage(this._SelectedChapter, this._SelectDifficult, this._MainFrame);
			this.SetupChapterExInfo();
			bool bAutoSelect = this._bAutoSelect;
			if (bAutoSelect)
			{
				bool flag = this._SelectScene > 0U;
				if (flag)
				{
					this._SetupDetailFrame(this._SelectScene);
				}
				this._bAutoSelect = false;
			}
		}

		// Token: 0x06010D6D RID: 68973 RVA: 0x0043F348 File Offset: 0x0043D548
		protected void SetupLeftChapterImage()
		{
			int previousChapter = XSingleton<XSceneMgr>.singleton.GetPreviousChapter(this._SelectedChapter);
			bool flag = previousChapter == 0;
			if (!flag)
			{
				bool flag2 = this._LeftFrame == null;
				if (flag2)
				{
					this._LeftFrame = this.GetLevelFrame();
				}
				bool flag3 = this._LeftFrame == null;
				if (flag3)
				{
					XSingleton<XDebug>.singleton.AddGreenLog("SetupLeftChapterImage,_LeftFrame is null!", null, null, null, null, null);
				}
				else
				{
					bool flag4 = this._MainFrame == null;
					if (flag4)
					{
						XSingleton<XDebug>.singleton.AddGreenLog("SetupLeftChapterImage,_MainFrame is null!", null, null, null, null, null);
					}
					else
					{
						this._LeftFrame.transform.localPosition = this._MainFrame.transform.localPosition + new Vector3(-1136f, 0f);
						this._LeftFrame.name = "chapter" + previousChapter;
						this.SetupChapterBaseImage(previousChapter, this._SelectDifficult, this._LeftFrame);
					}
				}
			}
		}

		// Token: 0x06010D6E RID: 68974 RVA: 0x0043F44C File Offset: 0x0043D64C
		protected void SetupRightChapterImage()
		{
			int nextChapter = XSingleton<XSceneMgr>.singleton.GetNextChapter(this._SelectedChapter);
			bool flag = nextChapter == this._SelectedChapter;
			if (!flag)
			{
				int playerLastChapter = XSingleton<XStageProgress>.singleton.GetPlayerLastChapter(this._SelectDifficult);
				bool flag2 = nextChapter > playerLastChapter;
				if (!flag2)
				{
					bool flag3 = this._RightFrame == null;
					if (flag3)
					{
						this._RightFrame = this.GetLevelFrame();
					}
					bool flag4 = this._RightFrame == null;
					if (flag4)
					{
						XSingleton<XDebug>.singleton.AddGreenLog("SetupRightChapterImage,_RightFrame is null!", null, null, null, null, null);
					}
					else
					{
						bool flag5 = this._MainFrame == null;
						if (flag5)
						{
							XSingleton<XDebug>.singleton.AddGreenLog("SetupRightChapterImage,_MainFrame is null!", null, null, null, null, null);
						}
						else
						{
							this._RightFrame.transform.localPosition = this._MainFrame.transform.localPosition + new Vector3(1136f, 0f, 0f);
							this._RightFrame.name = "chapter" + nextChapter;
							this.SetupChapterBaseImage(nextChapter, this._SelectDifficult, this._RightFrame);
						}
					}
				}
			}
		}

		// Token: 0x06010D6F RID: 68975 RVA: 0x0043F57C File Offset: 0x0043D77C
		protected void SetupLevelChest(GameObject level, uint sceneID, int dropID, int rank)
		{
			IXUISprite ixuisprite = level.transform.Find("LevelPic").GetComponent("XUISprite") as IXUISprite;
			IXUISprite ixuisprite2 = level.transform.Find("Star1").GetComponent("XUISprite") as IXUISprite;
			IXUISprite ixuisprite3 = level.transform.Find("Star2").GetComponent("XUISprite") as IXUISprite;
			IXUISprite ixuisprite4 = level.transform.Find("Star3").GetComponent("XUISprite") as IXUISprite;
			GameObject gameObject = level.transform.Find("TaskHint").gameObject;
			IXUISprite ixuisprite5 = level.transform.Find("Box").GetComponent("XUISprite") as IXUISprite;
			IXUISprite ixuisprite6 = level.transform.Find("BoxFx").GetComponent("XUISprite") as IXUISprite;
			IXUILabel ixuilabel = level.transform.Find("Hint").GetComponent("XUILabel") as IXUILabel;
			IXUISprite ixuisprite7 = level.transform.Find("SprBtn").GetComponent("XUISprite") as IXUISprite;
			ixuisprite7.SetGrey(rank > 0);
			ixuisprite7.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSceneChestClicked));
			ixuisprite7.ID = (ulong)sceneID;
			ixuisprite6.gameObject.SetActive(false);
			bool flag = this._SelectDifficult == 0U;
			if (flag)
			{
				ixuisprite.SetSprite("gk_0");
			}
			else
			{
				ixuisprite.SetSprite("gk_1");
			}
			ixuisprite2.gameObject.SetActive(false);
			ixuisprite3.gameObject.SetActive(false);
			ixuisprite4.gameObject.SetActive(false);
			gameObject.gameObject.SetActive(false);
			ixuilabel.gameObject.SetActive(false);
			ixuisprite5.gameObject.SetActive(true);
			ixuisprite5.ID = (ulong)sceneID;
		}

		// Token: 0x06010D70 RID: 68976 RVA: 0x0043F768 File Offset: 0x0043D968
		public void SetupChangeChapterUI()
		{
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			int previousChapter = XSingleton<XSceneMgr>.singleton.GetPreviousChapter(this._SelectedChapter);
			bool flag = previousChapter > 0;
			if (flag)
			{
				base.uiBehaviour.m_Left.gameObject.SetActive(true);
				GameObject gameObject = base.uiBehaviour.m_Left.gameObject.transform.Find("RedPoint").gameObject;
				bool flag2 = xlevelDocument.HasChapterRedpoint(previousChapter);
				if (flag2)
				{
					gameObject.SetActive(true);
				}
				else
				{
					gameObject.SetActive(false);
				}
			}
			else
			{
				base.uiBehaviour.m_Left.gameObject.SetActive(false);
			}
			int nextChapter = XSingleton<XSceneMgr>.singleton.GetNextChapter(this._SelectedChapter);
			int playerLastChapter = XSingleton<XStageProgress>.singleton.GetPlayerLastChapter(this._SelectDifficult);
			bool flag3 = nextChapter != this._SelectedChapter && playerLastChapter >= nextChapter;
			if (flag3)
			{
				base.uiBehaviour.m_Right.gameObject.SetActive(true);
				GameObject gameObject2 = base.uiBehaviour.m_Right.gameObject.transform.Find("RedPoint").gameObject;
				bool flag4 = xlevelDocument.HasChapterRedpoint(nextChapter);
				if (flag4)
				{
					gameObject2.SetActive(true);
				}
				else
				{
					gameObject2.SetActive(false);
				}
			}
			else
			{
				base.uiBehaviour.m_Right.gameObject.SetActive(false);
			}
			bool flag5 = this._SelectDifficult == 0U;
			if (flag5)
			{
				base.uiBehaviour.m_NormalRedpoint.SetActive(false);
				base.uiBehaviour.m_HardRedpoint.SetActive(xlevelDocument.HasDifficultAllChapterRedpoint(1));
			}
			else
			{
				base.uiBehaviour.m_HardRedpoint.SetActive(false);
				base.uiBehaviour.m_NormalRedpoint.SetActive(xlevelDocument.HasDifficultAllChapterRedpoint(0));
			}
		}

		// Token: 0x06010D71 RID: 68977 RVA: 0x0043F945 File Offset: 0x0043DB45
		public override void StackRefresh()
		{
			base.StackRefresh();
			base.Alloc3DAvatarPool("DungeonSelect");
			this.SetupPlayerAvatar();
			this.SetupBossAvatar(this._SelectedChapter, this._SelectDifficult, this._MainFrame);
			this.RefreshHardLeftCount();
		}

		// Token: 0x06010D72 RID: 68978 RVA: 0x0043F984 File Offset: 0x0043DB84
		public void SetupPlayerAvatar()
		{
			bool flag = this.main.fx != null;
			if (flag)
			{
				this.main.fx.SetActive(true);
				IXUITweenTool ixuitweenTool = this.main.fx.transform.Find("me").GetComponent("XUIPlayTween") as IXUITweenTool;
				bool flag2 = ixuitweenTool != null;
				if (flag2)
				{
					ixuitweenTool.StopTween();
					ixuitweenTool.ResetTween(true);
					ixuitweenTool.PlayTween(true, -1f);
				}
			}
		}

		// Token: 0x06010D73 RID: 68979 RVA: 0x0043FA0C File Offset: 0x0043DC0C
		public void UpdateSceneEnterTime()
		{
			bool activeInHierarchy = base.uiBehaviour.m_SceneDetail.activeInHierarchy;
			if (activeInHierarchy)
			{
				this._SetupDetailFrame(this._SelectScene);
				this.RefreshHardLeftCount();
			}
		}

		// Token: 0x06010D74 RID: 68980 RVA: 0x0043FA44 File Offset: 0x0043DC44
		public void UpdateSceneBox()
		{
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			Transform transform = this._MainFrame.transform.Find("Levels");
			int childCount = transform.childCount;
			for (int i = 0; i < childCount; i++)
			{
				Transform child = transform.GetChild(i);
				bool flag = !child.gameObject.name.StartsWith("chest");
				if (!flag)
				{
					IXUISprite ixuisprite = child.Find("LevelPic").GetComponent("XUISprite") as IXUISprite;
					IXUISprite ixuisprite2 = child.Find("Box").GetComponent("XUISprite") as IXUISprite;
					IXUISprite ixuisprite3 = child.Find("BoxFx").GetComponent("XUISprite") as IXUISprite;
					IXUITweenTool ixuitweenTool = child.Find("Box").GetComponent("XUIPlayTween") as IXUITweenTool;
					uint num = (uint)ixuisprite2.ID;
					SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(num);
					bool flag2 = sceneData != null && sceneData.SceneChest > 0;
					if (flag2)
					{
						ixuisprite2.gameObject.SetActive(true);
						bool flag3 = xlevelDocument.SceneBox.Contains(num);
						if (flag3)
						{
							ixuisprite2.spriteName = "xz01_1";
							ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSceneChestClicked));
							ixuisprite3.gameObject.SetActive(false);
							ixuisprite.SetEnabled(true);
							ixuitweenTool.ResetTween(true);
						}
						else
						{
							ixuisprite2.spriteName = "xz01_0";
							ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSceneChestClicked));
							int rank = XSingleton<XStageProgress>.singleton.GetRank((int)num);
							bool flag4 = rank <= 0;
							if (flag4)
							{
								ixuisprite3.gameObject.SetActive(false);
								ixuisprite.SetEnabled(false);
								ixuitweenTool.ResetTween(true);
							}
							else
							{
								ixuisprite3.gameObject.SetActive(true);
								ixuisprite.SetEnabled(true);
								ixuitweenTool.PlayTween(true, -1f);
							}
						}
					}
				}
			}
			this.SetupChangeChapterUI();
		}

		// Token: 0x06010D75 RID: 68981 RVA: 0x0043FC74 File Offset: 0x0043DE74
		protected void OnSceneChestClicked(IXUISprite sp)
		{
			base.uiBehaviour.m_BoxFrame.SetActive(true);
			base.uiBehaviour.m_BoxFetch.ID = sp.ID;
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData((uint)sp.ID);
			bool flag = sceneData == null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddGreenLog("OnSceneChestClicked sceneData is null", null, null, null, null, null);
			}
			else
			{
				XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
				base.uiBehaviour.m_BoxRedPoint.SetActive(false);
				base.uiBehaviour.m_BoxChest.SetActive(true);
				base.uiBehaviour.m_BoxStar.gameObject.SetActive(false);
				int rank = XSingleton<XStageProgress>.singleton.GetRank((int)sp.ID);
				bool flag2 = rank <= 0;
				if (flag2)
				{
					base.uiBehaviour.m_BoxFetch.SetEnable(false, false);
					base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCH"));
				}
				else
				{
					bool flag3 = xlevelDocument.SceneBox.Contains((uint)sceneData.id);
					if (flag3)
					{
						base.uiBehaviour.m_BoxFetch.SetEnable(false, false);
						base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCHED"));
					}
					else
					{
						base.uiBehaviour.m_BoxFetch.SetEnable(true, false);
						base.uiBehaviour.m_BoxRedPoint.SetActive(true);
						base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCH"));
					}
				}
				this.SetupBoxReward(sceneData.SceneChest);
				base.uiBehaviour.m_BoxFetch.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSceneChestBoxFetch));
			}
		}

		// Token: 0x06010D76 RID: 68982 RVA: 0x0043FE40 File Offset: 0x0043E040
		protected void ReturnLevelFrameToPool(GameObject frame)
		{
			bool flag = frame == null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddErrorLog("ReturnLevelFrameToPool frame is null", null, null, null, null, null);
			}
			else
			{
				List<GameObject> list = new List<GameObject>();
				Transform transform = frame.transform.Find("Levels");
				bool flag2 = transform == null;
				if (!flag2)
				{
					for (int i = 0; i < transform.childCount; i++)
					{
						list.Add(transform.GetChild(i).gameObject);
					}
					for (int j = 0; j < list.Count; j++)
					{
						base.uiBehaviour.m_ScenePool.ReturnInstance(list[j], true);
					}
					base.uiBehaviour.m_SceneFramePool.ReturnInstance(frame, false);
				}
			}
		}

		// Token: 0x06010D77 RID: 68983 RVA: 0x0043FF14 File Offset: 0x0043E114
		protected bool OnLevelBgDrag(Vector2 delta)
		{
			bool flag = delta.x > 0f;
			if (flag)
			{
				this.OnMoveLeft(null);
			}
			else
			{
				this.OnMoveRight(null);
			}
			return true;
		}

		// Token: 0x06010D78 RID: 68984 RVA: 0x0043FF50 File Offset: 0x0043E150
		protected bool OnMoveLeft(IXUIButton go)
		{
			bool bLevelIsMoving = this._bLevelIsMoving;
			bool result;
			if (bLevelIsMoving)
			{
				result = true;
			}
			else
			{
				int previousChapter = XSingleton<XSceneMgr>.singleton.GetPreviousChapter(this._SelectedChapter);
				bool flag = previousChapter > 0;
				if (flag)
				{
					this._SelectedChapter = previousChapter;
					Vector3 localPosition = base.uiBehaviour.m_LevelTween.gameObject.transform.Find("LevelFramePanel").localPosition;
					Vector3 to = localPosition + new Vector3(1136f, 0f);
					bool flag2 = base.uiBehaviour.m_LevelTween != null;
					if (flag2)
					{
						this._bLevelIsMoving = true;
					}
					base.uiBehaviour.m_LevelTween.ResetTweenByGroup(true, 0);
					base.uiBehaviour.m_LevelTween.SetPositionTweenPos(1, localPosition, to);
					base.uiBehaviour.m_LevelTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnMoveLeftOver));
					base.uiBehaviour.m_LevelTween.PlayTween(true, -1f);
					XSingleton<XDebug>.singleton.AddLog("MoveLeft-->> _bLevelIsMoving =" + this._bLevelIsMoving.ToString(), null, null, null, null, null, XDebugColor.XDebug_None);
				}
				result = true;
			}
			return result;
		}

		// Token: 0x06010D79 RID: 68985 RVA: 0x0044007C File Offset: 0x0043E27C
		protected void OnMoveLeftOver(IXUITweenTool tween)
		{
			this._bLevelIsMoving = false;
			this.ReturnLevelFrameToPool(this._MainFrame);
			bool flag = this._RightFrame != null;
			if (flag)
			{
				this.ReturnLevelFrameToPool(this._RightFrame);
			}
			this._RightFrame = null;
			this._MainFrame = this._LeftFrame;
			this._LeftFrame = null;
			this.main.Copy(ref this.left);
			this.left.Clear();
			this.right.Clear();
			this.SetupChapterExInfo();
			XSingleton<XDebug>.singleton.AddLog("MoveLeftOver..... _bLevelIsMoving =" + this._bLevelIsMoving.ToString(), null, null, null, null, null, XDebugColor.XDebug_None);
		}

		// Token: 0x06010D7A RID: 68986 RVA: 0x00440130 File Offset: 0x0043E330
		protected bool OnMoveRight(IXUIButton go)
		{
			bool bLevelIsMoving = this._bLevelIsMoving;
			bool result;
			if (bLevelIsMoving)
			{
				result = true;
			}
			else
			{
				int nextChapter = XSingleton<XSceneMgr>.singleton.GetNextChapter(this._SelectedChapter);
				int playerLastChapter = XSingleton<XStageProgress>.singleton.GetPlayerLastChapter(this._SelectDifficult);
				bool flag = nextChapter != this._SelectedChapter && playerLastChapter >= nextChapter;
				if (flag)
				{
					this._SelectedChapter = nextChapter;
					Vector3 localPosition = base.uiBehaviour.m_LevelTween.gameObject.transform.Find("LevelFramePanel").localPosition;
					Vector3 to = localPosition + new Vector3(-1136f, 0f);
					bool flag2 = base.uiBehaviour.m_LevelTween != null;
					if (flag2)
					{
						this._bLevelIsMoving = true;
					}
					base.uiBehaviour.m_LevelTween.ResetTweenByGroup(true, 0);
					base.uiBehaviour.m_LevelTween.SetPositionTweenPos(1, localPosition, to);
					base.uiBehaviour.m_LevelTween.RegisterOnFinishEventHandler(new OnTweenFinishEventHandler(this.OnMoveRightOver));
					base.uiBehaviour.m_LevelTween.PlayTween(true, -1f);
					XSingleton<XDebug>.singleton.AddLog("MoveRight-->> _bLevelIsMoving =" + this._bLevelIsMoving.ToString(), null, null, null, null, null, XDebugColor.XDebug_None);
				}
				result = true;
			}
			return result;
		}

		// Token: 0x06010D7B RID: 68987 RVA: 0x0044027C File Offset: 0x0043E47C
		protected void OnMoveRightOver(IXUITweenTool tween)
		{
			this._bLevelIsMoving = false;
			this.ReturnLevelFrameToPool(this._MainFrame);
			bool flag = this._LeftFrame != null;
			if (flag)
			{
				this.ReturnLevelFrameToPool(this._LeftFrame);
			}
			this._LeftFrame = null;
			this._MainFrame = this._RightFrame;
			this._RightFrame = null;
			this.main.Copy(ref this.right);
			this.left.Clear();
			this.right.Clear();
			this.SetupChapterExInfo();
			XSingleton<XDebug>.singleton.AddLog("MoveRightOver..... _bLevelIsMoving =" + this._bLevelIsMoving.ToString(), null, null, null, null, null, XDebugColor.XDebug_None);
		}

		// Token: 0x06010D7C RID: 68988 RVA: 0x00440330 File Offset: 0x0043E530
		protected void SetupChapterExInfo()
		{
			bool flag = this._MainFrame == null;
			if (flag)
			{
				this._bLevelIsMoving = false;
				XSingleton<XDebug>.singleton.AddGreenLog("SetupChapterExInfo,_MainFrame is null!", null, null, null, null, null);
			}
			else
			{
				Transform parent = this._MainFrame.transform.Find("me/Effect");
				this.PlayEffect(ref this.m_fx, this.EffectPath, parent);
				parent = this._MainFrame.transform.Find("me/Effect/Effect");
				this.PlayEffect(ref this.m_fx1, this.EffectPath1, parent);
				this.SetupLeftChapterImage();
				this.SetupRightChapterImage();
				this.SetupPlayerAvatar();
				this.SetupBossAvatar(this._SelectedChapter, this._SelectDifficult, this._MainFrame);
				this.SetupChapterBoxProgress();
				this.SetupChangeChapterUI();
				this.UpdateSceneEnterTime();
				this.UpdateSceneBox();
			}
		}

		// Token: 0x06010D7D RID: 68989 RVA: 0x00440410 File Offset: 0x0043E610
		private void PlayEffect(ref XFx fx, string path, Transform parent)
		{
			bool flag = fx == null;
			if (flag)
			{
				fx = XSingleton<XFxMgr>.singleton.CreateFx(path, null, true);
			}
			else
			{
				fx.SetActive(true);
			}
			fx.Play(parent, Vector3.zero, Vector3.one, 1f, true, false);
		}

		// Token: 0x06010D7E RID: 68990 RVA: 0x0044045C File Offset: 0x0043E65C
		public void SetupChapterBoxProgress()
		{
			List<uint> list = ListPool<uint>.Get();
			XSingleton<XSceneMgr>.singleton.GetSceneListByChapter(this._SelectedChapter, list);
			bool flag = list.Count == 0;
			if (flag)
			{
				ListPool<uint>.Release(list);
			}
			else
			{
				list.Sort();
				this._ChapterTotalRank = (this._ChapterRank = 0);
				this._FirstNoRankScene = 0U;
				for (int i = 0; i < list.Count; i++)
				{
					uint num = list[i];
					SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(num);
					int num2 = 0;
					bool flag2 = sceneData != null;
					if (flag2)
					{
						num2 = XSingleton<XStageProgress>.singleton.GetRank(sceneData.id);
					}
					bool flag3 = num2 == -1;
					if (flag3)
					{
						num2 = 0;
					}
					bool flag4 = sceneData != null;
					if (flag4)
					{
						this._ChapterTotalRank += 3;
						this._ChapterRank += num2;
					}
					bool flag5 = num2 <= 0;
					if (flag5)
					{
						bool flag6 = this._FirstNoRankScene == 0U;
						if (flag6)
						{
							this._FirstNoRankScene = num;
						}
					}
				}
				ListPool<uint>.Release(list);
				base.uiBehaviour.m_Rank.SetText(this._ChapterRank + "/" + this._ChapterTotalRank);
				base.uiBehaviour.m_RankProgress.value = (float)this._ChapterRank / (float)this._ChapterTotalRank;
				XChapter.RowData chapter = XSingleton<XSceneMgr>.singleton.GetChapter(this._SelectedChapter);
				bool flag7 = chapter == null;
				if (flag7)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("SetupChapterBoxProgress chData is null", null, null, null, null, null);
				}
				else
				{
					int num3 = 390;
					base.uiBehaviour.m_RankBox.FakeReturnAll();
					for (int j = 0; j < chapter.Drop.Count; j++)
					{
						int num4 = chapter.Drop[j, 0];
						GameObject gameObject = base.uiBehaviour.m_RankBox.FetchGameObject(false);
						gameObject.transform.localPosition = base.uiBehaviour.m_RankBox.TplPos + new Vector3((float)(num3 * num4 / this._ChapterTotalRank), 0f);
						IXUISprite ixuisprite = gameObject.GetComponent("XUISprite") as IXUISprite;
						IXUISprite ixuisprite2 = gameObject.transform.Find("Box").GetComponent("XUISprite") as IXUISprite;
						IXUILabel ixuilabel = gameObject.transform.Find("Star").GetComponent("XUILabel") as IXUILabel;
						IXUITweenTool ixuitweenTool = gameObject.transform.Find("Box").GetComponent("XUIPlayTween") as IXUITweenTool;
						IXUISprite ixuisprite3 = gameObject.transform.Find("Fx").GetComponent("XUISprite") as IXUISprite;
						ixuilabel.SetText(num4.ToString());
						ixuisprite2.ID = (ulong)((long)j);
						ixuisprite2.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnChapterBoxClicked));
						ixuisprite.ID = (ulong)((long)j);
						ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnChapterBoxClicked));
						bool flag8 = this._ChapterRank >= num4;
						if (flag8)
						{
							bool flag9 = XSingleton<XStageProgress>.singleton.HasChapterBoxFetched(this._SelectedChapter, j);
							if (flag9)
							{
								ixuisprite2.spriteName = "xz02_1";
								ixuisprite3.SetAlpha(0f);
								ixuitweenTool.ResetTween(true);
							}
							else
							{
								ixuisprite2.spriteName = "xz02_0";
								ixuisprite3.SetAlpha(1f);
								ixuitweenTool.PlayTween(true, -1f);
							}
						}
						else
						{
							ixuisprite2.spriteName = "xz02_0";
							ixuisprite3.SetAlpha(0f);
							ixuitweenTool.ResetTween(true);
						}
					}
					base.uiBehaviour.m_RankBox.ActualReturnAll(false);
				}
			}
		}

		// Token: 0x06010D7F RID: 68991 RVA: 0x00440840 File Offset: 0x0043EA40
		protected void OnChapterBoxClicked(IXUISprite sp)
		{
			bool bLevelIsMoving = this._bLevelIsMoving;
			if (!bLevelIsMoving)
			{
				base.uiBehaviour.m_BoxFrame.SetActive(true);
				int index = (int)sp.ID;
				base.uiBehaviour.m_BoxFetch.ID = sp.ID;
				base.uiBehaviour.m_BoxRedPoint.SetActive(false);
				XChapter.RowData chapter = XSingleton<XSceneMgr>.singleton.GetChapter(this._SelectedChapter);
				bool flag = chapter == null;
				if (flag)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("OnChapterBoxClicked chdata is null", null, null, null, null, null);
				}
				else
				{
					base.uiBehaviour.m_BoxChest.SetActive(false);
					base.uiBehaviour.m_BoxStar.gameObject.SetActive(true);
					base.uiBehaviour.m_BoxStar.SetText(chapter.Drop[index, 0] + "/" + this._ChapterTotalRank);
					bool flag2 = this._ChapterRank < chapter.Drop[index, 0];
					if (flag2)
					{
						base.uiBehaviour.m_BoxFetch.SetEnable(false, false);
						base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCH"));
					}
					else
					{
						bool flag3 = XSingleton<XStageProgress>.singleton.HasChapterBoxFetched(this._SelectedChapter, index);
						if (flag3)
						{
							base.uiBehaviour.m_BoxFetch.SetEnable(false, false);
							base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCHED"));
						}
						else
						{
							base.uiBehaviour.m_BoxFetch.SetEnable(true, false);
							base.uiBehaviour.m_BoxRedPoint.SetActive(true);
							base.uiBehaviour.m_BoxFetch.SetCaption(XStringDefineProxy.GetString("SRS_FETCH"));
						}
					}
					this.SetupBoxReward(chapter.Drop[index, 1]);
					base.uiBehaviour.m_BoxFetch.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnChapterBoxFetch));
				}
			}
		}

		// Token: 0x06010D80 RID: 68992 RVA: 0x00440A44 File Offset: 0x0043EC44
		protected void SetupBoxReward(int dropID)
		{
			base.uiBehaviour.m_BoxRewardPool.ReturnAll(false);
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			List<XDropData> dropData = xlevelDocument.GetDropData(dropID);
			bool flag = dropData != null;
			if (flag)
			{
				int num = (dropData.Count + 1) / 2 - 1;
				int num2 = (int)((float)((dropData.Count + 1) % 2) * base.uiBehaviour.m_BoxRewardPool.TplPos.x);
				Vector3 vector = new Vector3((float)(num2 - num * base.uiBehaviour.m_BoxRewardPool.TplWidth), base.uiBehaviour.m_BoxRewardPool.TplPos.y);
				for (int i = 0; i < dropData.Count; i++)
				{
					XDropData xdropData = dropData[i];
					GameObject gameObject = base.uiBehaviour.m_BoxRewardPool.FetchGameObject(false);
					gameObject.transform.localPosition = vector + new Vector3((float)(i * base.uiBehaviour.m_BoxRewardPool.TplWidth), 0f);
					XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(gameObject, xdropData.itemID, xdropData.count, false);
					IXUISprite ixuisprite = gameObject.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite;
					ixuisprite.ID = (ulong)((long)xdropData.itemID);
					ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(XSingleton<UiUtility>.singleton.OnItemClick));
				}
			}
		}

		// Token: 0x06010D81 RID: 68993 RVA: 0x00440BD3 File Offset: 0x0043EDD3
		protected void OnChapterBoxBgClick(IXUISprite sp)
		{
			base.uiBehaviour.m_BoxFrame.SetActive(false);
		}

		// Token: 0x06010D82 RID: 68994 RVA: 0x00440BE8 File Offset: 0x0043EDE8
		protected bool OnChapterBoxFetch(IXUIButton go)
		{
			RpcC2G_FetchChapterChest rpcC2G_FetchChapterChest = new RpcC2G_FetchChapterChest();
			rpcC2G_FetchChapterChest.oArg.chapterID = this._SelectedChapter;
			rpcC2G_FetchChapterChest.oArg.chestID = (int)go.ID;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2G_FetchChapterChest);
			return true;
		}

		// Token: 0x06010D83 RID: 68995 RVA: 0x00440C34 File Offset: 0x0043EE34
		protected bool OnSceneChestBoxFetch(IXUIButton go)
		{
			RpcC2G_OpenSceneChest rpcC2G_OpenSceneChest = new RpcC2G_OpenSceneChest();
			rpcC2G_OpenSceneChest.oArg.sceneID = (uint)go.ID;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2G_OpenSceneChest);
			return true;
		}

		// Token: 0x06010D84 RID: 68996 RVA: 0x00440C6C File Offset: 0x0043EE6C
		public void OnFetchSceneChestSucc()
		{
			base.uiBehaviour.m_BoxFrame.SetActive(false);
			this.UpdateSceneBox();
		}

		// Token: 0x06010D85 RID: 68997 RVA: 0x00440C88 File Offset: 0x0043EE88
		public void OnFetchChapterBoxSucc()
		{
			base.uiBehaviour.m_BoxFrame.SetActive(false);
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			xlevelDocument.RefreshRedPoint();
			this.SetupChapterBoxProgress();
		}

		// Token: 0x06010D86 RID: 68998 RVA: 0x00440CD0 File Offset: 0x0043EED0
		protected void _SetupDetailFrame(uint sceneID)
		{
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			XMainInterfaceDocument xmainInterfaceDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XMainInterfaceDocument.uuID) as XMainInterfaceDocument;
			base.uiBehaviour.m_SceneDetail.gameObject.SetActive(true);
			this._SceneRemainTime = 9999U;
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(sceneID);
			int rank = XSingleton<XStageProgress>.singleton.GetRank((int)sceneID);
			uint sceneDifficult = (uint)XSingleton<XSceneMgr>.singleton.GetSceneDifficult((int)sceneID);
			bool flag = sceneData == null;
			if (flag)
			{
				XSingleton<XDebug>.singleton.AddErrorLog("_SetupDetailFrame sceneData is null", null, null, null, null, null);
			}
			else
			{
				base.uiBehaviour.m_SceneRecommendHint.SetVisible(0 < sceneData.RecommendHint.Length);
				base.uiBehaviour.m_SceneRecommendHint.SetText(string.Format("       {0}", sceneData.RecommendHint));
				bool flag2 = sceneDifficult == 0U;
				if (flag2)
				{
					base.uiBehaviour.m_SceneNormal.SetActive(true);
					base.uiBehaviour.m_SceneHard.SetActive(false);
					base.uiBehaviour.m_HardLeftCountGo1.SetActive(false);
					base.uiBehaviour.m_SceneSoloBattle.gameObject.SetActive(false);
					base.uiBehaviour.m_SceneTeamBattle.gameObject.SetActive(false);
					base.uiBehaviour.m_SceneGoBattle.gameObject.SetActive(true);
				}
				else
				{
					base.uiBehaviour.m_SceneNormal.SetActive(false);
					base.uiBehaviour.m_SceneHard.SetActive(true);
					base.uiBehaviour.m_HardLeftCountGo1.SetActive(true);
					base.uiBehaviour.m_SceneGoBattle.gameObject.SetActive(false);
					bool flag3 = rank <= 0;
					if (flag3)
					{
						base.uiBehaviour.m_SceneSoloBattle.gameObject.SetActive(false);
						base.uiBehaviour.m_SceneTeamBattle.gameObject.SetActive(true);
						base.uiBehaviour.m_SceneTeamBattle.gameObject.transform.localPosition = base.uiBehaviour.m_SceneGoBattle.gameObject.transform.localPosition;
					}
					else
					{
						base.uiBehaviour.m_SceneSoloBattle.gameObject.SetActive(false);
						base.uiBehaviour.m_SceneTeamBattle.gameObject.SetActive(true);
						base.uiBehaviour.m_SceneTeamBattle.gameObject.transform.localPosition = base.uiBehaviour.m_SceneTeamBattlePos;
					}
				}
				base.uiBehaviour.m_SceneName.SetText(sceneData.Comment);
				int num = -1;
				for (int i = 0; i < XLevelRewardDocument.Table.Table.Length; i++)
				{
					bool flag4 = XLevelRewardDocument.Table.Table[i].scendid == sceneID;
					if (flag4)
					{
						num = i;
						break;
					}
				}
				bool flag5 = num >= 0;
				if (flag5)
				{
					base.uiBehaviour.m_SceneStarCond[1].SetText(LevelRewardGerenalHandler.GetReqText(XLevelRewardDocument.Table.Table[num], 1));
					base.uiBehaviour.m_SceneStarCond[2].SetText(LevelRewardGerenalHandler.GetReqText(XLevelRewardDocument.Table.Table[num], 2));
				}
				for (int j = 0; j < 3; j++)
				{
					bool rankDetail = XSingleton<XStageProgress>.singleton.GetRankDetail((int)sceneID, j);
					if (rankDetail)
					{
						base.uiBehaviour.m_SceneStar[j].SetColor(Color.white);
					}
					else
					{
						base.uiBehaviour.m_SceneStar[j].SetColor(Color.grey);
					}
				}
				base.uiBehaviour.m_SceneDropPool.ReturnAll(false);
				Vector3 tplPos = base.uiBehaviour.m_SceneDropPool.TplPos;
				int tplWidth = base.uiBehaviour.m_SceneDropPool.TplWidth;
				int tplHeight = base.uiBehaviour.m_SceneDropPool.TplHeight;
				bool flag6 = XSingleton<XAttributeMgr>.singleton.XPlayerData != null;
				if (flag6)
				{
					int num2 = (int)(xlevelDocument.GetExpAddition((int)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level) * (double)sceneData.Exp);
					base.uiBehaviour.m_DropExpLab.SetText(num2.ToString());
				}
				bool flag7 = sceneData.Money == 0;
				if (flag7)
				{
					base.uiBehaviour.m_DropExpLab1.gameObject.transform.parent.gameObject.SetActive(false);
				}
				else
				{
					base.uiBehaviour.m_DropExpLab1.gameObject.transform.parent.gameObject.SetActive(true);
					base.uiBehaviour.m_DropExpLab1.SetText(sceneData.Money.ToString());
				}
				int num3 = (sceneData.ViewableDropList != null) ? sceneData.ViewableDropList.Length : 0;
				int num4 = 6;
				int num5 = Mathf.Max(num3, num4);
				for (int k = 0; k < num5; k++)
				{
					int num6 = k;
					GameObject gameObject = base.uiBehaviour.m_SceneDropPool.FetchGameObject(false);
					gameObject.name = k.ToString();
					gameObject.transform.localPosition = tplPos + new Vector3((float)(tplWidth * num6), 0f, 0f);
					gameObject.transform.localScale = Vector3.one;
					GameObject gameObject2 = gameObject.transform.Find("Item").gameObject;
					bool flag8 = k >= num3 && k < num4;
					if (flag8)
					{
						gameObject2.SetActive(false);
					}
					else
					{
						gameObject2.SetActive(true);
						XSingleton<XItemDrawerMgr>.singleton.normalItemDrawer.DrawItem(gameObject2, sceneData.ViewableDropList[k], 0, false);
						IXUISprite ixuisprite = gameObject2.transform.Find("Icon").GetComponent("XUISprite") as IXUISprite;
						ixuisprite.ID = (ulong)sceneData.ViewableDropList[k];
						ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnClickItemIcon));
					}
				}
				int playerPPT = xmainInterfaceDocument.GetPlayerPPT();
				string difficulty = XLevelDocument.GetDifficulty(playerPPT, sceneData.RecommendPower);
				base.uiBehaviour.m_SceneHint.SetText(difficulty);
				base.uiBehaviour.m_SceneRecommendPPT.SetText(string.Format("{0}{1}[-]", difficulty.Substring(0, 8), sceneData.RecommendPower));
				base.uiBehaviour.m_SceneMyPPT.SetText(playerPPT.ToString());
				bool flag9 = this._SelectDifficult == 1U;
				if (flag9)
				{
					bool flag10 = playerPPT >= sceneData.SweepNeedPPT;
					string arg;
					if (flag10)
					{
						arg = "[9ce500]";
					}
					else
					{
						arg = "[e30000]";
					}
					bool flag11 = XSingleton<XAttributeMgr>.singleton.XPlayerData != null;
					if (flag11)
					{
						bool flag12 = (ulong)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level < (ulong)((long)XSingleton<XGlobalConfig>.singleton.GetInt("SweepPPTLevelLimit"));
						if (flag12)
						{
							base.uiBehaviour.m_SweepPPT.gameObject.SetActive(false);
							base.uiBehaviour.m_SweepPPTName.SetActive(false);
						}
						else
						{
							base.uiBehaviour.m_SweepPPT.gameObject.SetActive(true);
							base.uiBehaviour.m_SweepPPT.SetText(string.Format("{0}{1}[-]", arg, sceneData.SweepNeedPPT));
							base.uiBehaviour.m_SweepPPTName.SetActive(true);
							base.uiBehaviour.m_SweepTicketLab.SetText(XBagDocument.BagDoc.GetItemCount(XSingleton<XGlobalConfig>.singleton.GetInt("SweepTicketId")).ToString());
						}
					}
					base.uiBehaviour.m_SceneQuick10Lab.SetText(string.Format(XStringDefineProxy.GetString("SWEEP_TITLE"), 5));
				}
				else
				{
					base.uiBehaviour.m_SweepPPT.SetText("");
					base.uiBehaviour.m_SweepPPTName.SetActive(false);
					base.uiBehaviour.m_SceneQuick10Lab.SetText(string.Format(XStringDefineProxy.GetString("SWEEP_TITLE"), 10));
				}
				uint num7 = sceneData.DayLimitGroupID;
				bool flag13 = num7 == 0U;
				if (flag13)
				{
					num7 = sceneID;
				}
				uint num8 = 0U;
				bool flag14 = xlevelDocument.SceneDayEnter.TryGetValue(num7, out num8);
				if (flag14)
				{
					this._SceneRemainTime = (uint)sceneData.DayLimit - num8;
					bool flag15 = (long)sceneData.DayLimit - (long)((ulong)num8) == 0L;
					if (flag15)
					{
						base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(false);
						base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(false);
					}
					else
					{
						base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(true);
						base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(true);
					}
				}
				else
				{
					base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(true);
					base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(true);
				}
				bool flag16 = rank < 3;
				if (flag16)
				{
					base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(false);
					base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(false);
					base.uiBehaviour.m_SweepTicketGo.SetActive(false);
					base.uiBehaviour.m_SceneFirstSSS.SetActive(true);
					string text = "";
					for (int l = 0; l < sceneData.FirstSSS.Count; l++)
					{
						text += XLabelSymbolHelper.FormatCostWithIcon((int)sceneData.FirstSSS[l, 1], (ItemEnum)sceneData.FirstSSS[l, 0]);
					}
					base.uiBehaviour.m_SceneFirstSSSReward.InputText = text;
				}
				else
				{
					bool flag17 = this._SelectDifficult == 0U;
					if (flag17)
					{
						base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(true);
						base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(true);
						base.uiBehaviour.m_SweepTicketGo.SetActive(false);
					}
					else
					{
						bool flag18 = XSingleton<XAttributeMgr>.singleton.XPlayerData != null;
						if (flag18)
						{
							bool flag19 = (ulong)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level < (ulong)((long)XSingleton<XGlobalConfig>.singleton.GetInt("SweepPPTLevelLimit"));
							if (flag19)
							{
								base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(false);
								base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(false);
								base.uiBehaviour.m_SweepTicketGo.SetActive(false);
							}
							else
							{
								base.uiBehaviour.m_SceneQuick1.gameObject.SetActive(true);
								base.uiBehaviour.m_SceneQuick10.gameObject.SetActive(true);
								base.uiBehaviour.m_SweepTicketGo.SetActive(true);
							}
						}
					}
					base.uiBehaviour.m_SceneFirstSSS.SetActive(false);
				}
				base.uiBehaviour.m_Cost.InputText = XLabelSymbolHelper.FormatCostWithIcon(sceneData.FatigueCost[0, 1], ItemEnum.FATIGUE);
				base.uiBehaviour.m_SceneSoloBattleCost.InputText = XLabelSymbolHelper.FormatCostWithIcon(sceneData.FatigueCost[0, 1], ItemEnum.FATIGUE);
				base.uiBehaviour.m_SceneTeamBattleCost.InputText = XLabelSymbolHelper.FormatCostWithIcon(sceneData.FatigueCost[0, 1], ItemEnum.FATIGUE);
			}
		}

		// Token: 0x06010D87 RID: 68999 RVA: 0x0044185C File Offset: 0x0043FA5C
		private void OnClickItemIcon(IXUISprite spr)
		{
			XItem mainItem = XBagDocument.MakeXItem((int)spr.ID, false);
			XSingleton<UiUtility>.singleton.ShowTooltipDialogWithSearchingCompare(mainItem, spr, false, 0U);
		}

		// Token: 0x06010D88 RID: 69000 RVA: 0x00441888 File Offset: 0x0043FA88
		private void OnSceneSelected(IXUISprite sp)
		{
			XLevelDocument xlevelDocument = XSingleton<XGame>.singleton.Doc.GetXComponent(XLevelDocument.uuID) as XLevelDocument;
			this._SelectScene = (uint)sp.ID;
			bool flag = this._FirstNoRankScene > 0U;
			if (flag)
			{
				bool flag2 = this._SelectScene == this._FirstNoRankScene;
				if (flag2)
				{
					SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(this._SelectScene);
					bool flag3 = sceneData == null;
					if (flag3)
					{
						XSingleton<XDebug>.singleton.AddErrorLog("OnSceneSelected sceneData is null", null, null, null, null, null);
						return;
					}
					SceneRefuseReason sceneRefuseReason = xlevelDocument.CanLevelOpen(this._SelectScene);
					bool flag4 = sceneRefuseReason == SceneRefuseReason.PreTask_Notfinish;
					if (flag4)
					{
						base.uiBehaviour.m_MainHintText.SetText(string.Format(XStringDefineProxy.GetString("LEVEl_REQUIRE_TASK"), sceneData.RequiredLevel));
						base.uiBehaviour.m_MainHint.PlayTween(true, -1f);
						return;
					}
					bool flag5 = sceneRefuseReason == SceneRefuseReason.PreScene_Notfinish;
					if (flag5)
					{
						int unFinishedPreSceneID = xlevelDocument.GetUnFinishedPreSceneID(sceneData);
						SceneTable.RowData sceneData2 = XSingleton<XSceneMgr>.singleton.GetSceneData((uint)unFinishedPreSceneID);
						bool flag6 = sceneData2 != null;
						if (flag6)
						{
							base.uiBehaviour.m_MainHintText.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_PRELEVEL"), sceneData2.Comment));
						}
						base.uiBehaviour.m_MainHint.PlayTween(true, -1f);
						return;
					}
					bool flag7 = sceneRefuseReason == SceneRefuseReason.Level_NotEnough;
					if (flag7)
					{
						base.uiBehaviour.m_MainHintText.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_LEVEL"), sceneData.RequiredLevel));
						base.uiBehaviour.m_MainHint.PlayTween(true, -1f);
						return;
					}
					bool flag8 = sceneRefuseReason == SceneRefuseReason.ReachLimitTimes;
					if (flag8)
					{
						base.uiBehaviour.m_MainHintText.SetText(XStringDefineProxy.GetString("LEVEL_REACH_LIMIT_TIMES"));
						base.uiBehaviour.m_MainHint.PlayTween(false, -1f);
						return;
					}
				}
				bool flag9 = this._SelectScene > this._FirstNoRankScene;
				if (flag9)
				{
					base.uiBehaviour.m_MainHintText.SetText(string.Format(XStringDefineProxy.GetString("LEVEL_REQUIRE_DEFAULT"), new object[0]));
					base.uiBehaviour.m_MainHint.PlayTween(true, -1f);
					return;
				}
			}
			this._SetupDetailFrame(this._SelectScene);
		}

		// Token: 0x06010D89 RID: 69001 RVA: 0x00441AE4 File Offset: 0x0043FCE4
		public void OnPlayerLevelUp()
		{
			bool flag = base.IsVisible();
			if (flag)
			{
				this.SetupChapterImage();
			}
		}

		// Token: 0x06010D8A RID: 69002 RVA: 0x00441B04 File Offset: 0x0043FD04
		public void OnGotSweepRes()
		{
			bool flag = base.IsVisible();
			if (flag)
			{
				this.SetupChapterImage();
			}
		}

		// Token: 0x06010D8B RID: 69003 RVA: 0x00441B24 File Offset: 0x0043FD24
		public bool OnDetailClose(IXUIButton go)
		{
			base.uiBehaviour.m_SceneDetail.SetActive(false);
			return true;
		}

		// Token: 0x06010D8C RID: 69004 RVA: 0x00441B4C File Offset: 0x0043FD4C
		public void RefreshHardLeftCount()
		{
			XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument<XExpeditionDocument>(XExpeditionDocument.uuID);
			int dayCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelAbyss, null);
			int dayMaxCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelAbyss, null);
			string text = string.Format("{0}/{1}", dayCount, dayMaxCount);
			base.uiBehaviour.m_HardLeftCount1.SetText(text);
			bool flag = this._welfareDoc.IsOwnMemberPrivilege(MemberPrivilege.KingdomPrivilege_Adventurer);
			if (flag)
			{
				int num = 0;
				PayMemberTable.RowData memberPrivilegeConfig = this._welfareDoc.GetMemberPrivilegeConfig(MemberPrivilege.KingdomPrivilege_Adventurer);
				bool flag2 = memberPrivilegeConfig != null;
				if (flag2)
				{
					num = memberPrivilegeConfig.AbyssCount;
				}
				int num2 = 0;
				bool flag3 = this._welfareDoc.PayMemberPrivilege != null;
				if (flag3)
				{
					num2 = this._welfareDoc.PayMemberPrivilege.usedAbyssCount;
				}
				bool flag4 = num2 >= num;
				if (flag4)
				{
					base.uiBehaviour.m_HardLeftCount0.SetText(string.Format("{0}/{1}", dayCount, dayMaxCount));
					base.uiBehaviour.m_HardLeftCount1.SetText(string.Format("{0}/{1}", dayCount, dayMaxCount));
				}
				else
				{
					base.uiBehaviour.m_HardLeftCount0.SetText(string.Format("[ffb400][c]{0}[/c][-]/{1}", dayCount, dayMaxCount));
					base.uiBehaviour.m_HardLeftCount1.SetText(string.Format("[ffb400][c]{0}[/c][-]/{1}", dayCount, dayMaxCount));
				}
			}
			else
			{
				base.uiBehaviour.m_HardLeftCount0.SetText(string.Format("{0}/{1}", dayCount, dayMaxCount));
				base.uiBehaviour.m_HardLeftCount1.SetText(string.Format("{0}/{1}", dayCount, dayMaxCount));
			}
		}

		// Token: 0x06010D8D RID: 69005 RVA: 0x00441D08 File Offset: 0x0043FF08
		private void _OnAddHardCountClicked(IXUISprite iSp)
		{
			DlgBase<XBuyCountView, XBuyCountBehaviour>.singleton.ActiveShow(TeamLevelType.TeamLevelAbyss);
		}

		// Token: 0x06010D8E RID: 69006 RVA: 0x00441D18 File Offset: 0x0043FF18
		private bool OnShopBtnClick(IXUIButton btn)
		{
			SeqList<int> sequenceList = XSingleton<XGlobalConfig>.singleton.GetSequenceList("AbyssTeamShopLevel", true);
			List<int> intList = XSingleton<XGlobalConfig>.singleton.GetIntList("AbyssTeamShopType");
			int num = 0;
			bool flag = XSingleton<XAttributeMgr>.singleton.XPlayerData != null;
			if (flag)
			{
				num = (int)XSingleton<XAttributeMgr>.singleton.XPlayerData.Level;
			}
			for (int i = 0; i < (int)sequenceList.Count; i++)
			{
				bool flag2 = num >= sequenceList[i, 0] && num <= sequenceList[i, 1];
				if (flag2)
				{
					XSysDefine xsysDefine = (XSysDefine)(XFastEnumIntEqualityComparer<XSysDefine>.ToInt(XSysDefine.XSys_Mall_MystShop) + intList[i]);
					bool flag3 = XSingleton<XGameSysMgr>.singleton.IsSystemOpened(xsysDefine);
					bool result;
					if (flag3)
					{
						DlgBase<MallSystemDlg, MallSystemBehaviour>.singleton.ShowShopSystem(xsysDefine, 0UL);
						result = true;
					}
					else
					{
						int sysOpenLevel = XSingleton<XGameSysMgr>.singleton.GetSysOpenLevel(XFastEnumIntEqualityComparer<XSysDefine>.ToInt(xsysDefine));
						XSingleton<UiUtility>.singleton.ShowSystemTip(string.Format(XStringDefineProxy.GetString("SHOP_OPEN_LEVEL"), sysOpenLevel), "fece00");
						result = false;
					}
					return result;
				}
			}
			XSingleton<XDebug>.singleton.AddErrorLog("Can't find player level state from golbalconfig by AbyssTeamShop. level = ", num.ToString(), null, null, null, null);
			return true;
		}

		// Token: 0x04007B8C RID: 31628
		private bool _isShowBossAvatar = true;

		// Token: 0x04007B8D RID: 31629
		private int _HardModeNeedLevel = 0;

		// Token: 0x04007B8E RID: 31630
		private uint _SelectDifficult = 0U;

		// Token: 0x04007B8F RID: 31631
		private int _SelectedChapter = 0;

		// Token: 0x04007B90 RID: 31632
		private uint _SelectScene = 0U;

		// Token: 0x04007B91 RID: 31633
		private bool _bAutoSelect = false;

		// Token: 0x04007B92 RID: 31634
		private bool _bAutoSelectChapterId = true;

		// Token: 0x04007B93 RID: 31635
		private GameObject _MainFrame;

		// Token: 0x04007B94 RID: 31636
		private GameObject _LeftFrame;

		// Token: 0x04007B95 RID: 31637
		private GameObject _RightFrame;

		// Token: 0x04007B96 RID: 31638
		private bool m_bLevelIsMoving = false;

		// Token: 0x04007B97 RID: 31639
		private int _ChapterRank;

		// Token: 0x04007B98 RID: 31640
		private int _ChapterTotalRank;

		// Token: 0x04007B99 RID: 31641
		private const float LEVEL_FRAME_OFFSET = 1136f;

		// Token: 0x04007B9A RID: 31642
		private uint _FirstNoRankScene = 0U;

		// Token: 0x04007B9B RID: 31643
		private Dictionary<uint, GameObject> SceneDic = new Dictionary<uint, GameObject>();

		// Token: 0x04007B9C RID: 31644
		private uint _SceneRemainTime = 9999U;

		// Token: 0x04007B9D RID: 31645
		public bool IsTaskMode = false;

		// Token: 0x04007B9E RID: 31646
		private float m_fSweepBtnCoolTime = 0.5f;

		// Token: 0x04007B9F RID: 31647
		private float m_fGoBattleCoolTime = 5f;

		// Token: 0x04007BA0 RID: 31648
		private float m_fLastClickBtnTime = 0f;

		// Token: 0x04007BA1 RID: 31649
		private DungeonSelect.FrameCache main;

		// Token: 0x04007BA2 RID: 31650
		private DungeonSelect.FrameCache left;

		// Token: 0x04007BA3 RID: 31651
		private DungeonSelect.FrameCache right;

		// Token: 0x04007BA4 RID: 31652
		private XDummy bossDummy = null;

		// Token: 0x04007BA5 RID: 31653
		private XWelfareDocument _welfareDoc;

		// Token: 0x04007BA6 RID: 31654
		private GameObject m_goLevelUpGo;

		// Token: 0x04007BA7 RID: 31655
		private XFx m_fx;

		// Token: 0x04007BA8 RID: 31656
		private XFx m_fx1;

		// Token: 0x04007BA9 RID: 31657
		private string m_effectPath = string.Empty;

		// Token: 0x04007BAA RID: 31658
		private string m_effectPath1 = string.Empty;

		// Token: 0x02001A22 RID: 6690
		private struct FrameCache
		{
			// Token: 0x06011158 RID: 69976 RVA: 0x00458887 File Offset: 0x00456A87
			public void Clear()
			{
				this.snapShot = null;
				this.fx = null;
			}

			// Token: 0x06011159 RID: 69977 RVA: 0x00458898 File Offset: 0x00456A98
			public void Copy(ref DungeonSelect.FrameCache fc)
			{
				this.snapShot = fc.snapShot;
				bool flag = this.fx != null;
				if (flag)
				{
					this.fx.SetActive(false);
				}
				this.fx = fc.fx;
			}

			// Token: 0x04008278 RID: 33400
			public IUIDummy snapShot;

			// Token: 0x04008279 RID: 33401
			public GameObject fx;
		}
	}
}
